Analytics
Aggregate queries for a site or across the team: overview metrics, time series, breakdowns, comparisons, pages, referrers, channels, retention, and filter discovery.
Returns aggregate metrics for the time range, such as views, sessions, visitors, bounce rate, and average duration.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"metricsstring[]Metrics to return. Omit to return the default set (views, sessions, visitors, bounces, bounce rate, average duration, views per session).
"views""sessions""visitors""bounces""bounceRate""avgDurationMs""viewsPerSession""events"Returns aggregate metrics across all sites the API key can access.
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"metricsstring[]Metrics to return. Omit to return the default set (views, sessions, visitors, bounces, bounce rate, average duration, views per session).
"views""sessions""visitors""bounces""bounceRate""avgDurationMs""viewsPerSession""events"Compares metrics between two datasets, each with its own time range and filter, and returns current values, reference values, and their absolute and relative change. Optionally returns a trend for both.
Conditional scopes
[
{
"when": "current.filter.type=saved|reference.filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
version2requiredComparison contract version. Always 2.
timeZonestringrequiredIANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"currentobjectrequiredThe dataset being measured: a time range (absolute or preset) and an optional filter.
timeRangeobjectrequiredfilterobject | any | nullreferenceobjectrequiredThe dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.
timeRangeobjectrequiredfilterobject | any | nullselectobjectrequiredWhich metrics to compare, and optionally a trend with an interval and its own metric list.
metricsstring[]required"views""sessions""visitors""bounces""totalDurationMs""durationViews""bounceRate""avgDurationMs""viewsPerSession""events"trendobjectCompares two datasets row by row for one dimension (the path parameter), e.g. which pages gained or lost the most visitors.
Conditional scopes
[
{
"when": "current.filter.type=saved|reference.filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
dimensionstringrequiredDimension to group by. The analytics schema operation lists the dimensions available on this instance.
"page.path""page.title""page.hostname""page.query""page.hash""session.entryPath""session.exitPath""referrer.domain""referrer.url""utm.source""utm.medium""utm.campaign""utm.term""utm.content""client.browser""client.browserVersion""client.browserEngine""client.os""client.osVersion""client.deviceType""client.language""client.screenSize""geo.country""geo.region"+5version2requiredComparison contract version. Always 2.
timeZonestringrequiredIANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"currentobjectrequiredThe dataset being measured: a time range (absolute or preset) and an optional filter.
timeRangeobjectrequiredfilterobject | any | nullreferenceobjectrequiredThe dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.
timeRangeobjectrequiredfilterobject | any | nulllimitintegerrequiredMaximum number of rows, 1–200.
sortobjectrequiredSort by a current, reference, or change metric, or by key.
bystringrequired"current.views""current.sessions""current.visitors""reference.views""reference.sessions""reference.visitors""change.views.absolute""change.views.relative""change.sessions.absolute""change.sessions.relative""change.visitors.absolute""change.visitors.relative""key"directionstringrequired"asc""desc"Compares metrics between two team-wide datasets, each with its own time range and filter.
version2requiredComparison contract version. Always 2.
timeZonestringrequiredIANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"currentobjectrequiredThe dataset being measured: a time range (absolute or preset) and an optional filter.
timeRangeobjectrequiredfilterobject | any | nullreferenceobjectrequiredThe dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.
timeRangeobjectrequiredfilterobject | any | nullselectobjectrequiredWhich metrics to compare, and optionally a trend with an interval and its own metric list.
metricsstring[]required"views""sessions""visitors""bounces""totalDurationMs""durationViews""bounceRate""avgDurationMs""viewsPerSession""events"trendobjectCompares two team-wide datasets row by row for one dimension (the path parameter).
dimensionstringrequiredDimension to group by. The analytics schema operation lists the dimensions available on this instance.
"page.path""page.title""page.hostname""page.query""page.hash""session.entryPath""session.exitPath""referrer.domain""referrer.url""utm.source""utm.medium""utm.campaign""utm.term""utm.content""client.browser""client.browserVersion""client.browserEngine""client.os""client.osVersion""client.deviceType""client.language""client.screenSize""geo.country""geo.region"+5version2requiredComparison contract version. Always 2.
timeZonestringrequiredIANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"currentobjectrequiredThe dataset being measured: a time range (absolute or preset) and an optional filter.
timeRangeobjectrequiredfilterobject | any | nullreferenceobjectrequiredThe dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.
timeRangeobjectrequiredfilterobject | any | nulllimitintegerrequiredMaximum number of rows to return.
sortobjectrequiredSort field and direction.
bystringrequired"current.views""current.sessions""current.visitors""reference.views""reference.sessions""reference.visitors""change.views.absolute""change.views.relative""change.sessions.absolute""change.sessions.relative""change.visitors.absolute""change.visitors.relative""key"directionstringrequired"asc""desc"Lists the fields, operators, dimensions, and metrics available for this site's queries. Call it first to discover valid filter fields and breakdown dimensions.
siteIdstringrequiredID of the site (see List sites).
Lists the fields, operators, dimensions, and metrics available for team-wide queries.
Returns views, sessions, and visitors for each time bucket in the range.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"intervalstringrequiredBucket size of the time series: minute, hour, day, week, or month. Keep the number of buckets reasonable for the time range.
"minute""hour""day""week""month"Returns views, sessions, and visitors per time bucket across all accessible sites.
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"intervalstringrequiredBucket size of the time series: minute, hour, day, week, or month. Keep the number of buckets reasonable for the time range.
"minute""hour""day""week""month"Returns metrics for each accessible site, optionally with a small trend per site. Use it to build a sites overview.
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"intervalstringAdd a trend per site with this bucket size.
"minute""hour""day""week""month"pageobjectrequiredCursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.
limitintegerrequiredcursorstring | any | nullGroups traffic by one dimension (the path parameter), such as pages, countries, or browsers, and returns the top rows with their metrics.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
dimensionstringrequiredDimension to group by. The analytics schema operation lists the dimensions available on this instance.
"page.path""page.title""page.hostname""page.query""page.hash""session.entryPath""session.exitPath""referrer.domain""referrer.url""utm.source""utm.medium""utm.campaign""utm.term""utm.content""client.browser""client.browserVersion""client.browserEngine""client.os""client.osVersion""client.deviceType""client.language""client.screenSize""geo.country""geo.region"+5timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"limitintegerrequiredMaximum number of rows, 1–200.
Groups traffic across all accessible sites by one dimension (the path parameter).
dimensionstringrequiredDimension to group by. The analytics schema operation lists the dimensions available on this instance.
"page.path""page.title""page.hostname""page.query""page.hash""session.entryPath""session.exitPath""referrer.domain""referrer.url""utm.source""utm.medium""utm.campaign""utm.term""utm.content""client.browser""client.browserVersion""client.browserEngine""client.os""client.osVersion""client.deviceType""client.language""client.screenSize""geo.country""geo.region"+5timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"limitintegerrequiredMaximum number of rows to return.
Groups traffic by two dimensions: the top values of the primary dimension, each split by the top values of the secondary dimension.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"primaryDimensionstringrequiredFirst dimension, e.g. geo.country.
secondaryDimensionstringrequiredDimension used to split each primary row.
primaryLimitintegerrequiredNumber of primary rows, 1–12.
secondaryLimitintegerrequiredNumber of secondary rows per primary row, 1–8.
Lists the site's pages with their views and sessions, sorted by views.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"pageobjectrequiredCursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.
limitintegerrequiredcursorstring | any | nullincludeDetailsbooleanrequiredSplit rows by query string and hash instead of grouping them by path.
Lists the referring domains (or full URLs) that send traffic.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"sortstringrequiredSort by views or visitors.
"views""visitors"directionstringrequiredSort direction: asc or desc.
"asc""desc"pageobjectrequiredCursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.
limitintegerrequiredcursorstring | any | nullincludeFullUrlbooleanrequiredGroup by full referrer URL instead of domain.
searchstringOnly referrers containing this text.
Groups traffic into acquisition channels such as direct, organic search, social, and referral.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"limitintegerrequiredMaximum number of rows to return.
Returns the values seen for a filter field in the time range, with counts. Use it to build a filter or to suggest values.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"fieldstringrequiredA filter field from the analytics schema, e.g. geo.country. Event payload fields are not enumerable here; use Search event field values instead.
searchstringCase-insensitive text search.
pageobjectrequiredCursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.
limitintegerrequiredcursorstring | any | nullGroups visitors by the period of their first visit and returns the share that came back in each later period.
Conditional scopes
[
{
"when": "filter.type=saved",
"scopes": [
"analytics:read",
"analysis:read"
]
}
]siteIdstringrequiredID of the site (see List sites).
timeRangeobjectrequiredReporting 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 | nullOptional 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.
scopestringWhich entity a filter condition selects. auto (default) picks the narrowest scope that fits the expression; event, session, and visitor force one.
"auto""event""session""visitor"granularitystringrequiredCohort size: visitors are grouped by the minute, hour, day, week, or month of their first visit.
"minute""hour""day""week""month"