Get Site Stats
get_statsHeadline KPIs for a site as raw counts: visits, visitors, pageviews, clicks (outbound), bots, bounces, session_seconds, dur_sessions, each for the current and the previous period. Derive the rates yourself the way the dashboard does: bounce rate = bounces / visits; average visit duration = session_seconds / visits (every visit counts, a bounce as 0 s); bounces are one-page visits without an outbound click; visitors are page loaders only, hop_only_visitors passed through a redirect link without loading a page; CTR (the dashboard's CTR/V1 tile) = (clicks - bot_clicks) / visits. Defaults to the full retained history. new_visitors is null (and returning_visitors 0) when the site's Cookieless tracking setting is on: the daily id cannot tell a return visit, do not report them. If new_visitors is almost equal to visitors, the tracker runs cookieless but the dashboard switch is off: tell the user to turn on Website Settings > Cookieless tracking for that site. visitors includes redirect-only hops, so it can exceed pageviews.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | YYYY-MM-DD | |
| days | No | Window in days (omit for full history) | |
| from | No | YYYY-MM-DD | |
| site | Yes | ||
| filters | No | Narrow the report to the visits that match ALL of these (the dashboard's click-to-filter), inside the same window as the report. Omit for everything. |