Event Aggregate
rybbit_get_event_aggregateGroup and count analytics events by dimensions like user, path, or custom properties; filter by event name or properties to analyze trends and sessions.
Instructions
Aggregate events by one or more dimensions (e.g. identified_user_id, traits.username, pathname, properties.room_id). Filters by event_name and optional property filters, then groups remaining events. Returns { groups: [{key, count, first_seen, last_seen, sessions, extras}], scanned, hitCount, hasMore }. When hasMore: true, the scan was capped — narrow the time window or raise maxScan for more accuracy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topN | No | Return only the top N groups by count (default 50). | |
| siteId | Yes | Site ID (numeric ID or domain identifier) | |
| endDate | No | End date in ISO format (YYYY-MM-DD) | |
| filters | No | Array of filters. Example: [{parameter:'browser',type:'equals',value:['Chrome']},{parameter:'country',type:'equals',value:['US','DE']}] | |
| groupBy | Yes | One or more group keys. Built-in: 'identified_user_id', 'user_id', 'pathname', 'hostname', 'country', 'browser', 'device_type', 'traits.username', 'traits.sex'. Use 'properties.<name>' to group by an event property (e.g. 'properties.room_id'). | |
| maxScan | No | Maximum events to scan from the backend (default 5000). | |
| timeZone | No | IANA timezone (e.g., Europe/Prague). Default: UTC | |
| eventName | No | Optional exact event_name to filter for (e.g., 'pm_sent'). | |
| startDate | No | Start date in ISO format (YYYY-MM-DD) | |
| pastMinutesEnd | No | Alternative to dates: minutes ago end (default 0 = now) | |
| propertyFilters | No | Filters applied to parsed event properties after fetch. | |
| pastMinutesStart | No | Alternative to dates: minutes ago start (e.g., 60 = last hour) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | Yes | Grouped event counts, sorted by count DESC by default | |
| hasMore | Yes | True if scan was capped by maxScan and more data exists | |
| scanned | Yes | Total events scanned across pagination | |
| hitCount | Yes | Events matching eventName / property filters | |
| windowEnd | No | ||
| windowStart | No |