Ask a question about a site's traffic
query_site_analyticsAnswer ANY website traffic question the fixed summary does not cover, by building the report yourself: pick metrics, up to 3 breakdowns, filters, a window and an optional comparison. Examples: organic search visits day by day → breakdown ["date"], filters [{dimension:"channel", value:"Organic Search"}]; this month vs last month → start_date/end_date with compare "previous_period"; mobile vs desktop bounce rate → breakdown ["device"], metrics ["sessions","bounce_rate"]; which pages Instagram visitors land on → breakdown ["landing_page"], filters [{dimension:"source", value:"instagram", match:"contains"}]; busiest weekday or hour → breakdown ["weekday"] or ["hour"]; traffic by week per channel → breakdown ["week","channel"]; visits to one page over time → breakdown ["date"], filters [{dimension:"page", value:"/pricing"}]; conversions by source → metrics ["conversions"], breakdown ["source_medium"]. Channel values are names like "Organic Search", "Organic Social", "Direct", "Referral", "Paid Search", "Paid Social", "Email", "AI Assistant". Presets end yesterday (complete days) unless include_today is true. compare cannot be combined with a date, week or month breakdown. Rows come back with totals; the total visitor count counts each person once. Requires analytics to be enabled on the site. If a combination is rejected, the error says why: adjust and ask again rather than telling the user the data is unavailable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| period | No | Preset window ending yesterday (default last_28_days) | |
| compare | No | Also read the previous period or the same window a year earlier | |
| filters | No | Filters, all must hold | |
| metrics | No | What to count (default visitors and sessions) | |
| site_id | Yes | The site, from list_sites | |
| end_date | No | Window end, YYYY-MM-DD, inclusive | |
| order_by | No | A metric or breakdown in this question to sort by | |
| ascending | No | ||
| breakdown | No | Up to 3 ways to split the numbers, in order | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| start_date | No | Window start, YYYY-MM-DD (with end_date) | |
| include_today | No | Slide a preset to end today |