Documentation menuAPI: Metrics

API

Metric endpoints

metric is the endpoint behind most tables in the dashboard. You name a dimension, and it returns the values for that dimension with their counts. Scope: analytics:read. Public sites and private links can call it.

Last updated . This guide belongs to API access and data export.

GET /sites/:siteId/metric

ParameterRequiredMeaning
parameterYesThe dimension to group by
limitNoRows per page. Default 100, maximum 10,000
pageNoDefault 1

It also takes the shared time parameters, filters and segment_id.

Which dimensions can you use?

GroupValues for parameter
Pagespathname, page_title, querystring, entry_page, exit_page, hostname
Sourcesreferrer, channel, utm_source, utm_medium, utm_campaign, utm_term, utm_content
Locationcountry, region, city, timezone, language
Devicebrowser, browser_version, operating_system, operating_system_version, device_type, dimensions
Otherevent_name, tag
URL parametersurl_param:<name>, for any query parameter your site receives

The same names work as parameter inside filters, apart from url_param:<name>.

What does the response look like?

{ "data": { "data": [ { "value": "/pricing", "hostname": "example.com", "count": 412, "percentage": 22.35, "pageviews": 530, "pageviews_percentage": 12.86, "time_on_page_seconds": 41.7, "bounce_rate": 38.11 } ], "totalCount": 87 } }

Rows are sorted by count, highest first. count is sessions, apart from event_name, where it is events.

Page dimensions add pageviews, time_on_page_seconds and bounce_rate. totalCount is the number of rows across all pages.

GET /sites/:siteId/page-titles

Returns page titles with their path. limit defaults to 10. Send page to get totalCount as well.