vexo_count_events
Aggregate event counts over a date range, with optional grouping by dimensions like user or device, to compare cohorts and analyze trends.
Instructions
Aggregate event counts over a date range, optionally grouped by a dimension. The workhorse for cohort comparison. Ranges > 31 days are split & merged automatically (deduped by event id).
A "dimension" is any top-level field (deviceId, country, deviceSystemName, appVersion, route, sessionId, deviceModel, city, type) OR any metadata key (e.g. "worker_id", "user_id").
Inputs: start_date, end_date: ISO dates (end inclusive of the day). group_by: OPTIONAL dimension to group by, e.g. "worker_id". If omitted, the server's configured group key is used; if none, results are totaled by event_name only. filter_values: OPTIONAL list restricting group_by to these values, e.g. ["54","111","2716"] to compare a specific cohort. Max 200. filters: OPTIONAL extra key/value constraints, e.g. {"deviceSystemName":"iOS"}. event_names: OPTIONAL list to restrict which events are counted.
Returns: { window, group_by, rows:[{group?, event_name, count}], truncated, total_count? }. Sorted by group then count desc. Groups/events with zero matches are absent. On failure: { error }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | Yes | ||
| end_date | Yes | ||
| group_by | No | dimension to group by, e.g. "worker_id" | |
| filter_values | No | restrict group_by to these values | |
| filters | No | extra constraints, e.g. {"country":"United States"} | |
| event_names | No |