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"]. Checkout progress: metrics ["events","visitors"], breakdown ["event"] or ["date","event"]. Filter event exactly to begin_checkout, checkout_contact_completed, checkout_review_viewed, checkout_request_started, checkout_modal_opened, checkout_payment_form_ready, checkout_payment_submitted, checkout_redirected, checkout_closed, checkout_load_failed, checkout_payment_attempt_failed, checkout_abandoned, checkout_completed or purchase. Counts by event are activity counts, not a verified ordered funnel or payment failure rate. Channel values are names like "Organic Search", "Organic Social", "Direct", "Referral", "Paid Search", "Paid Social", "Paid Other", "Email", "AI Assistant". "Paid Other" is paid traffic from a source the analytics does not recognise (for example ads shown on chatgpt.com): break it down by source_medium and campaign before answering, and name the source. 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>"
},
"name": "query_site_analytics"
}
}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 |