Analytics

Query analytics totals and breakdowns

Returns aggregate engagement totals — page views, distinct visitors, visits, bounces, and total time in seconds — for a date range, optionally broken down by one dimension. Use it to answer "how much traffic did the site get" and "what are the top pages/referrers/countries" style questions; use the timeseries endpoint when you need values over time instead. startAt and endAt are Unix epoch milliseconds; optional filter parameters (path, referrer, country, event, UTM fields, ...) narrow the data. Without dimension the response carries the totals alone. With dimension (e.g. path for top pages, referrer for top referrers, country for top countries) the response also carries rows: up to limit (default 25, max 1000) values of that dimension ranked by page views, each with its own engagement totals. Requires a plan that includes analytics (403 otherwise); all-zero totals until the website is published and has traffic.

get/websites/{websiteId}/analytics/query

Request

  • Base URL: https://api.cactal.ai/v1
  • URL: https://api.cactal.ai/v1/websites/{websiteId}/analytics/query
  • Auth: HTTP bearer

Path parameters

websiteIdstring required

Query parameters

startAtinteger required
endAtinteger required
pathstring
referrerstring
titlestring
querystring
browserstring
osstring
devicestring
countrystring
regionstring
citystring
languagestring
hostnamestring
tagstring
eventstring
distinctIdstring
utmSourcestring
utmMediumstring
utmCampaignstring
utmContentstring
utmTermstring
segmentstring uuid
cohortstring uuid
dimension'path' | 'entry' | 'exit' | 'title' | 'query' | 'referrer' | 'channel' | 'domain' | 'country' | 'region' | 'city' | 'browser' | 'os' | 'device' | 'language' | 'screen' | 'event' | 'hostname' | 'tag' | 'distinctId'

Break the range down by this dimension, e.g. path for top pages, referrer for top referrers, country for top countries. Omit for totals only.

limitinteger

Maximum number of dimension rows to return (default 25, max 1000). Only used when dimension is set.

Response

Engagement totals for the range, plus ranked rows when a dimension was requested.

pageviewsnumber required

Total page views.

visitorsnumber required

Distinct visitors.

visitsnumber required

Visits (sessions).

bouncesnumber required

Single-page visits.

totaltimenumber required

Total time spent in seconds, summed across visits.

Changes

No recorded changes to this operation across all 1 revision of this API.