Documentation
APIAPI reference

Goals

Manage goals and read their conversion summary and trend.

POST/api/v1/sites/{siteId}/analytics/goals/summary

Get goal summary

Returns a goal's conversions and conversion rate by sessions and by visitors.

Scopesanalytics:read
Conditional scopes
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
Path parameters
siteIdstringrequired

ID of the site (see List sites).

≥ 1 chars
Request bodyapplication/json
timeRangeobjectrequired

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | any | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

Allowed"auto""event""session""visitor"
goalIdstringrequired

ID of a goal (see List goals).

1–512 chars
Responses
POST/api/v1/sites/{siteId}/analytics/goals/timeseries

Get goal time series

Returns a goal's conversions for each time bucket.

Scopesanalytics:read
Conditional scopes
[
  {
    "when": "filter.type=saved",
    "scopes": [
      "analytics:read",
      "analysis:read"
    ]
  }
]
Path parameters
siteIdstringrequired

ID of the site (see List sites).

≥ 1 chars
Request bodyapplication/json
timeRangeobjectrequired

Reporting window. Use { "kind": "preset", "preset": "last_7_days" } or an absolute range { "kind": "absolute", "from": "…", "to": "…" } with RFC 3339 timestamps. timeZone (IANA name) sets calendar boundaries for presets and buckets.

filterobject | any | null

Optional filter: { "type": "dsl", "expression": "page.path startsWith \"/blog\"" } uses the filter language, { "type": "inline", "expression": … } passes a structured expression, and { "type": "saved", "id": "…" } references a saved filter (requires analysis:read). Team queries accept dsl and inline only. Use null or omit the field for no filter.

scopestring

Which entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.

Allowed"auto""event""session""visitor"
goalIdstringrequired

ID of a goal (see List goals).

1–512 chars
intervalstringrequired

Bucket size of the time series: minute, hour, day, week, or month. Keep the number of buckets reasonable for the time range.

Allowed"minute""hour""day""week""month"
Responses
GET/api/v1/sites/{siteId}/goals

List goals

Lists the site's goals.

Scopesanalysis:read
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
Query parameters
limitinteger

Maximum number of results per page.

Default 501–200
cursorstring | any | null

Opaque pagination cursor from the previous response.

Responses
POST/api/v1/sites/{siteId}/goals

Create goal

Creates a goal. A goal converts when an event, page view, session, or visitor matches its filter.

Scopesanalysis:write
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
Request bodyapplication/json
filterDslVersion1required

Filter language version. Always 1.

Default 1
filterDslstringrequired

Filter expression that defines a conversion.

1–65536 chars
namestringrequired

Display name.

1–200 chars
Responses
GET/api/v1/sites/{siteId}/goals/{goalId}

Get goal

Returns one goal.

Scopesanalysis:read
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
goalIdstringrequired

ID of the goal.

1–256 chars
Responses
PATCH/api/v1/sites/{siteId}/goals/{goalId}

Update goal

Updates a goal. Send only the fields to change.

Scopesanalysis:write
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
goalIdstringrequired

ID of the goal.

1–256 chars
Request bodyapplication/json
filterDslVersion1
Default 1
filterDslstring
1–65536 chars
namestring
1–200 chars
Responses
DELETE/api/v1/sites/{siteId}/goals/{goalId}

Delete goal

Deletes a goal. Collected data is not affected.

Scopesanalysis:write
Path parameters
siteIdstringrequired

ID of the site (see List sites).

1–256 chars
goalIdstringrequired

ID of the goal.

1–256 chars
Responses