Overview totals
Every metric for a date range in the website timezone, with the comparison period and visitors online now. Money values are integer minor units in the website currency; rates are percentages (null when there is nothing to divide by). Pass filters as a JSON array of { dimension, operator, values } (combined with AND); an entry may also be an "or" group { or: [filter, …] } matching visits that match any of its filters. goal with is_not keeps the visits that did not complete the goal. Pass segment to apply a saved segment.
Related: Time series and Breakdown by dimension in Analytics.
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 analytics:read scope.
Response
Totals.
{
"status": "string",
"data": {
"current": "string",
"previous": "string",
"range": {
"from": "string",
"to": "string",
"timezone": "string",
"rawDataFrom": "string",
"approximate": true
},
"previousRange": {
"from": "string",
"to": "string",
"timezone": "string",
"rawDataFrom": "string",
"approximate": true
},
"onlineNow": 0,
"warnings": [
{
"code": "sampled",
"message": "string",
"fraction": 0,
"day": "string"
}
]
}
}Response fields
| Field | Type | Description |
|---|---|---|
| status | "ok" | |
| data | object | |
| data.current | object<string, number> | |
| data.previous | object<string, number> | null | null | |
| data.range | object | |
| data.range.from | string | |
| data.range.to | string | |
| data.range.timezone | string | |
| data.range.rawDataFrom | string | null | null | |
| data.range.approximate | boolean | |
| data.previousRange | object | null | null | |
| data.previousRange.from | string | |
| data.previousRange.to | string | |
| data.previousRange.timezone | string | |
| data.previousRange.rawDataFrom | string | null | null | |
| data.previousRange.approximate | boolean | |
| data.onlineNow | integer | |
| data.warnings | object[] | |
| data.warnings[].code | string | |
| data.warnings[].message | string | |
| data.warnings[].fraction | number | |
| data.warnings[].day | string |