Goals report
Every goal completed in the date range with completions, converting visitors, conversion rate and revenue from converters, plus the display settings set in the dashboard. Takes the same date range and filters as the analytics endpoints.
Related: Goals over time and Recent goal completions in Goals.
Request
Path parameters
websitestringrequiredWebsite id or domain, e.g. example.com
1–253 characters
Query parameters
periodstringoptionalOne of: realtime, today, yesterday, last_24h, last_7d, last_30d, last_90d, last_12m, week_to_date, last_week, month_to_date, last_month, year_to_date, all, custom · Default: "last_30d"
fromstringoptionalPattern: ^\d{4}-\d{2}-\d{2}$
tostringoptionalPattern: ^\d{4}-\d{2}-\d{2}$
granularitystringoptionalOne of: minute, hour, day, week, month
comparestringoptionalOne of: previous_period, previous_period_dow, year_over_year, custom, none · Default: "previous_period"
compareFromstringoptionalPattern: ^\d{4}-\d{2}-\d{2}$
compareTostringoptionalPattern: ^\d{4}-\d{2}-\d{2}$
filtersobject[] | stringoptionalsegmentstringoptionalPattern: ^[a-f0-9]{24}$
pinstringoptional1–22 characters
Headers
AuthorizationstringrequiredBearer followed by a site key, an account token or an OAuth access token with the goals:read scope.
Response
Goals.
{
"status": "string",
"data": {
"range": {
"from": "string",
"to": "string",
"timezone": "string"
},
"previousRange": {
"from": "string",
"to": "string",
"timezone": "string"
},
"currency": "string",
"totals": {
"visitors": 0,
"completions": 0,
"conversionRate": "string",
"revenue": "string"
},
"goals": [
{
"name": "string",
"displayName": "string",
"description": "string",
"colour": "string",
"hidden": true,
"kpi": true,
"customized": true,
"values": {
"completions": 0,
"visitors": 0,
"conversionRate": "string",
"revenue": "string"
},
"previous": {
"completions": 0,
"visitors": 0,
"conversionRate": "string",
"revenue": "string"
}
}
]
}
}Response fields
| Field | Type | Description |
|---|---|---|
| status | "ok" | |
| data | object | |
| data.range | object | |
| data.range.from | string | |
| data.range.to | string | |
| data.range.timezone | string | |
| data.previousRange | object | null | null | |
| data.previousRange.from | string | |
| data.previousRange.to | string | |
| data.previousRange.timezone | string | |
| data.currency | string | |
| data.totals | object | |
| data.totals.visitors | integer | |
| data.totals.completions | integer | |
| data.totals.conversionRate | number | null | null | |
| data.totals.revenue | integer | null | null | |
| data.goals | object[] | |
| data.goals[].name | string | |
| data.goals[].displayName | string | null | null | |
| data.goals[].description | string | null | null | |
| data.goals[].colour | string | null | null | |
| data.goals[].hidden | boolean | |
| data.goals[].kpi | boolean | |
| data.goals[].customized | boolean | |
| data.goals[].values | object | |
| data.goals[].values.completions | integer | |
| data.goals[].values.visitors | integer | |
| data.goals[].values.conversionRate | number | null | null | |
| data.goals[].values.revenue | integer | null | null | |
| data.goals[].previous | object | null | null | |
| data.goals[].previous.completions | integer | |
| data.goals[].previous.visitors | integer | |
| data.goals[].previous.conversionRate | number | null | null | |
| data.goals[].previous.revenue | integer | null | null |