Documentation
APIAPI reference

Analytics

Aggregate queries for a site or across the team: overview metrics, time series, breakdowns, comparisons, pages, referrers, channels, retention, and filter discovery.

POST/api/v1/sites/{siteId}/analytics/overview

Returns aggregate metrics for the time range, such as views, sessions, visitors, bounce rate, and average duration.

Scopesanalytics:readBatchable
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"
metricsstring[]

Metrics to return. Omit to return the default set (views, sessions, visitors, bounces, bounce rate, average duration, views per session).

Allowed"views""sessions""visitors""bounces""bounceRate""avgDurationMs""viewsPerSession""events"
1–20 items
Responses
POST/api/v1/team/analytics/overview

Returns aggregate metrics across all sites the API key can access.

Scopesanalytics:readBatchable
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"
metricsstring[]

Metrics to return. Omit to return the default set (views, sessions, visitors, bounces, bounce rate, average duration, views per session).

Allowed"views""sessions""visitors""bounces""bounceRate""avgDurationMs""viewsPerSession""events"
1–20 items
Responses
POST/api/v1/sites/{siteId}/analytics/comparison

Compare site datasets

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.

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

ID of the site (see List sites).

≥ 1 chars
Request bodyapplication/json
version2required

Comparison contract version. Always 2.

timeZonestringrequired

IANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.

1–80 chars
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"
currentobjectrequired

The dataset being measured: a time range (absolute or preset) and an optional filter.

timeRangeobjectrequired
filterobject | any | null
referenceobjectrequired

The dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.

timeRangeobjectrequired
filterobject | any | null
selectobjectrequired

Which metrics to compare, and optionally a trend with an interval and its own metric list.

metricsstring[]required
Allowed"views""sessions""visitors""bounces""totalDurationMs""durationViews""bounceRate""avgDurationMs""viewsPerSession""events"
1–10 items
trendobject
Responses
POST/api/v1/sites/{siteId}/analytics/comparison/breakdowns/{dimension}

Compares two datasets row by row for one dimension (the path parameter), e.g. which pages gained or lost the most visitors.

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

ID of the site (see List sites).

≥ 1 chars
dimensionstringrequired

Dimension to group by. The analytics schema operation lists the dimensions available on this instance.

Allowed"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"+5
≥ 1 chars
Request bodyapplication/json
version2required

Comparison contract version. Always 2.

timeZonestringrequired

IANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.

1–80 chars
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"
currentobjectrequired

The dataset being measured: a time range (absolute or preset) and an optional filter.

timeRangeobjectrequired
filterobject | any | null
referenceobjectrequired

The dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.

timeRangeobjectrequired
filterobject | any | null
limitintegerrequired

Maximum number of rows, 1–200.

Default 201–200
sortobjectrequired

Sort by a current, reference, or change metric, or by key.

Default {"by":"current.views","direction":"desc"}
bystringrequired
Allowed"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
Allowed"asc""desc"
Default "desc"
Responses
POST/api/v1/team/analytics/comparison

Compare team datasets

Compares metrics between two team-wide datasets, each with its own time range and filter.

Scopesanalytics:readBatchable
Request bodyapplication/json
version2required

Comparison contract version. Always 2.

timeZonestringrequired

IANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.

1–80 chars
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"
currentobjectrequired

The dataset being measured: a time range (absolute or preset) and an optional filter.

timeRangeobjectrequired
filterobject | any | null
referenceobjectrequired

The dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.

timeRangeobjectrequired
filterobject | any | null
selectobjectrequired

Which metrics to compare, and optionally a trend with an interval and its own metric list.

metricsstring[]required
Allowed"views""sessions""visitors""bounces""totalDurationMs""durationViews""bounceRate""avgDurationMs""viewsPerSession""events"
1–10 items
trendobject
Responses
POST/api/v1/team/analytics/comparison/breakdowns/{dimension}

Compares two team-wide datasets row by row for one dimension (the path parameter).

Scopesanalytics:readBatchable
Path parameters
dimensionstringrequired

Dimension to group by. The analytics schema operation lists the dimensions available on this instance.

Allowed"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"+5
≥ 1 chars
Request bodyapplication/json
version2required

Comparison contract version. Always 2.

timeZonestringrequired

IANA time zone used for both datasets, so presets and trend buckets use the same calendar boundaries.

1–80 chars
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"
currentobjectrequired

The dataset being measured: a time range (absolute or preset) and an optional filter.

timeRangeobjectrequired
filterobject | any | null
referenceobjectrequired

The dataset to compare against. Besides absolute and preset ranges, { "kind": "previous_period" } uses the period of equal length right before current.

timeRangeobjectrequired
filterobject | any | null
limitintegerrequired

Maximum number of rows to return.

Default 201–200
sortobjectrequired

Sort field and direction.

Default {"by":"current.views","direction":"desc"}
bystringrequired
Allowed"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
Allowed"asc""desc"
Default "desc"
Responses
GET/api/v1/sites/{siteId}/analytics/schema

Lists the fields, operators, dimensions, and metrics available for this site's queries. Call it first to discover valid filter fields and breakdown dimensions.

Scopesanalytics:readBatchable
Path parameters
siteIdstringrequired

ID of the site (see List sites).

≥ 1 chars
Responses
GET/api/v1/team/analytics/schema

Lists the fields, operators, dimensions, and metrics available for team-wide queries.

Scopesanalytics:readBatchable
Responses
POST/api/v1/sites/{siteId}/analytics/timeseries

Returns views, sessions, and visitors for each time bucket in the range.

Scopesanalytics:readBatchable
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"
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
POST/api/v1/team/analytics/timeseries

Returns views, sessions, and visitors per time bucket across all accessible sites.

Scopesanalytics:readBatchable
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"
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
POST/api/v1/team/analytics/sites

Returns metrics for each accessible site, optionally with a small trend per site. Use it to build a sites overview.

Scopesanalytics:readBatchable
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"
intervalstring

Add a trend per site with this bucket size.

Allowed"minute""hour""day""week""month"
pageobjectrequired

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

Default {"limit":20}
limitintegerrequired
Default 201–100
cursorstring | any | null
Responses
POST/api/v1/sites/{siteId}/analytics/breakdowns/{dimension}

Groups traffic by one dimension (the path parameter), such as pages, countries, or browsers, and returns the top rows with their metrics.

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

ID of the site (see List sites).

≥ 1 chars
dimensionstringrequired

Dimension to group by. The analytics schema operation lists the dimensions available on this instance.

Allowed"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"+5
≥ 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"
limitintegerrequired

Maximum number of rows, 1–200.

Default 201–200
Responses
POST/api/v1/team/analytics/breakdowns/{dimension}

Groups traffic across all accessible sites by one dimension (the path parameter).

Scopesanalytics:readBatchable
Path parameters
dimensionstringrequired

Dimension to group by. The analytics schema operation lists the dimensions available on this instance.

Allowed"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"+5
≥ 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"
limitintegerrequired

Maximum number of rows to return.

Default 201–200
Responses
POST/api/v1/sites/{siteId}/analytics/cross-breakdowns

Groups traffic by two dimensions: the top values of the primary dimension, each split by the top values of the secondary dimension.

Scopesanalytics:readBatchable
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"
primaryDimensionstringrequired

First dimension, e.g. geo.country.

1–128 chars
secondaryDimensionstringrequired

Dimension used to split each primary row.

1–128 chars
primaryLimitintegerrequired

Number of primary rows, 1–12.

Default 51–12
secondaryLimitintegerrequired

Number of secondary rows per primary row, 1–8.

Default 61–8
Responses
POST/api/v1/sites/{siteId}/analytics/pages

List site pages

Lists the site's pages with their views and sessions, sorted by views.

Scopesanalytics:readBatchable
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"
pageobjectrequired

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

Default {"limit":20}
limitintegerrequired
Default 201–200
cursorstring | any | null
includeDetailsbooleanrequired

Split rows by query string and hash instead of grouping them by path.

Default false
Responses
POST/api/v1/sites/{siteId}/analytics/referrers

List site referrers

Lists the referring domains (or full URLs) that send traffic.

Scopesanalytics:readBatchable
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"
sortstringrequired

Sort by views or visitors.

Allowed"views""visitors"
Default "views"
directionstringrequired

Sort direction: asc or desc.

Allowed"asc""desc"
Default "desc"
pageobjectrequired

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

Default {"limit":20}
limitintegerrequired
Default 201–200
cursorstring | any | null
includeFullUrlbooleanrequired

Group by full referrer URL instead of domain.

Default false
searchstring

Only referrers containing this text.

1–256 chars
Responses
POST/api/v1/sites/{siteId}/analytics/channels

List site channels

Groups traffic into acquisition channels such as direct, organic search, social, and referral.

Scopesanalytics:readBatchable
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"
limitintegerrequired

Maximum number of rows to return.

Default 201–200
Responses
POST/api/v1/sites/{siteId}/analytics/filter-values

Search filter values

Returns the values seen for a filter field in the time range, with counts. Use it to build a filter or to suggest values.

Scopesanalytics:readBatchable
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"
fieldstringrequired

A filter field from the analytics schema, e.g. geo.country. Event payload fields are not enumerable here; use Search event field values instead.

1–128 chars
searchstring

Case-insensitive text search.

≤ 256 chars
pageobjectrequired

Cursor pagination. Pass limit, then send cursor from the previous response's pagination.nextCursor to fetch the next page.

Default {"limit":50}
limitintegerrequired
Default 501–200
cursorstring | any | null
Responses
POST/api/v1/sites/{siteId}/analytics/retention/cohorts

Get retention cohorts

Groups visitors by the period of their first visit and returns the share that came back in each later period.

Scopesanalytics:readBatchable
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"
granularitystringrequired

Cohort size: visitors are grouped by the minute, hour, day, week, or month of their first visit.

Allowed"minute""hour""day""week""month"
Responses