GA4 period comparison
ga_compare_periodsCompare GA4 metrics between current and previous periods, broken down by dimensions like channel, with deltas and percent changes. Ideal for analyzing traffic shifts vs last month.
Instructions
Compare GA4 metrics between a current and a previous period, broken down by dimensions (default: channel group). Returns per-row current/previous/delta/percent change plus period totals. Use it for 'how did organic traffic change vs last month'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Rows returned (sorted by absolute change of the first metric). | |
| metrics | No | ||
| currentEnd | No | yesterday | |
| dimensions | No | ||
| propertyId | Yes | GA4 property ID, e.g. '123456789' (see ga_list_properties). | |
| filterLogic | No | How to join several dimensionFilters. | and |
| previousEnd | No | 29daysAgo | |
| currentStart | No | 28daysAgo | |
| metricFilters | No | AND-ed metric filters (post-aggregation). | |
| previousStart | No | 56daysAgo | |
| dimensionFilter | No | Raw FilterExpression; overrides dimensionFilters. | |
| dimensionFilters | No |