query_events
Query raw analytics events with filters on dimensions like page, country, device, and custom properties. Supports date ranges and pagination up to 1,000 events per call.
Instructions
Query raw events. Default returns the latest 100; max 1000 per call. For large analyses, paginate by date_range. Filters supported.
Optional dimension filters. Each filter is {dim, op, value}. Available dims: page, entry_page, exit_page, referrer, hostname, channel, ai_source, utm_source, utm_medium, utm_campaign, country, region, city, language, device, browser, screen, event_name, or prop:. Available ops: is, is_not, contains, not_contains. Filters AND together. Example: [{dim:'country', op:'is', value:'US'}, {dim:'device', op:'is_not', value:'mobile'}].
Optional date range. Either {preset:'last_7_days'} (also: today, yesterday, last_14_days, last_30_days, last_90_days, last_year, month_to_date, last_month, all_time) OR {from:'2026-05-01', to:'2026-05-15'} for a custom range (ISO 8601 dates or timestamps). Defaults vary by tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | No | Internal site UUID. Get one from list_sites. Omit to scope to the entire workspace. | |
| event_name | No | Custom event name (1–64 chars, alphanumeric + dot/dash/underscore). Optional when querying all events. | |
| date_range | No | Optional date range. Either {preset:'last_7_days'} OR {from:'2026-05-01', to:'2026-05-15'}. Defaults per tool — usually last_7_days. | |
| filters | No | AND-joined dimension filters. | |
| limit | No | Max events to return. Defaults to 100, capped at 1000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| events | Yes | Raw event rows, newest first. Up to opts.limit (default 100, max 1000). |