Endpoint
Authentication
Requires a Plugins API token with write access.Bearer token for authentication
Request Body
The request body accepts either a single goal or multiple goals (for bulk creation).Single Goal Creation
Type of goal to createOptions:
Goal.CustomEvent- Track custom eventsGoal.Pageview- Track pageview conversionsGoal.Revenue- Track revenue goals (requires Business plan)
Goal configuration object (structure varies by goal_type)
Custom Event Goal
Name of the custom event to trackRequirements:
- Maximum length: 120 characters
- Cannot be
engagement(reserved) - Will be trimmed of leading/trailing whitespace
Signup, Purchase, DownloadCustom properties filter for the goal (up to 3 properties)Requirements:
- Maximum 3 properties per goal
- Keys: 1-300 characters
- Values: 1-2000 characters
- Both keys and values must be strings
Pageview Goal
Page path to track as a goalRequirements:
- Must start with
/ - Will be trimmed of leading/trailing whitespace
- Leading slash is automatically added if missing
/pricing, /blog/*, /thank-youCustom properties filter for the goal (up to 3 properties)
Revenue Goal (Business Plan)
Name of the revenue event to track
Currency code for revenue trackingRequirements:
- Must be a valid ISO 4217 currency code
- Cannot be changed once the goal is created
- Each event name can only have one currency
USD, EUR, GBPCustom properties filter for the goal (up to 3 properties)
Bulk Goal Creation
Array of goal objects (maximum 8 goals)Each goal object follows the same structure as single goal creation.
Response
Array of created or retrieved goals
Type of goal:
Goal.CustomEvent, Goal.Pageview, or Goal.RevenueUnique identifier for the goal
Human-readable display name for the goal
- For custom events: same as event_name
- For pageviews: “Visit ”
Event name (for custom event and revenue goals)
Page path (for pageview goals)
Currency code (for revenue goals)
Custom properties filter configuration
Status Codes
201 Created- Goal(s) created or retrieved successfully400 Bad Request- Invalid request parameters401 Unauthorized- Missing or invalid API token402 Payment Required- Revenue goals require Business plan upgrade422 Unprocessable Entity- Validation error
Examples
Create Custom Event Goal
Create Pageview Goal
Create Goal with Custom Properties
Create Revenue Goal (Business Plan)
Bulk Create Goals
Error Responses
Validation Error
Maximum Goals Reached
Upgrade Required (Revenue Goals)
Currency Mismatch
Notes
- Goals are created with upsert behavior - if a goal already exists, it will be returned instead of creating a duplicate
- Display names are automatically generated: event name for custom events, “Visit ” for pageviews
- Leading and trailing whitespace in event names and paths is automatically trimmed
- Pageview goals automatically get a leading
/if not provided - Revenue goals cannot be created for consolidated views
- Once created, a revenue goal’s currency cannot be changed
- Custom properties require the Props feature (available on certain plans)
Related Endpoints
- List Goals - Retrieve all goals for a site
- Delete Goal - Remove a goal by ID
- Custom Events - Send custom events to track against goals