Compare Periods
compare_periodsCompare web analytics metrics side by side for two date ranges. Get aggregate values and the delta for before/after deployment analysis.
Instructions
Compare metrics between two date ranges side by side. Ideal for before/after deploy analysis. Returns aggregate values for each period plus the delta (absolute and %).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | No | Filter by goal name (e.g. Signup, Purchase) | |
| page | No | Filter by page path. Exact match by default, use * as trailing wildcard (e.g. /blog*) | |
| metrics | No | Metrics to return. Defaults vary by tool. | |
| site_id | No | Plausible site domain (e.g. example.com). Uses PLAUSIBLE_DEFAULT_SITE_ID if omitted. | |
| period_a | Yes | First date range, e.g. "2024-01-01,2024-01-07" or "7d" | |
| period_b | Yes | Second date range, e.g. "2024-01-08,2024-01-14" or "7d" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deltas | Yes | Per-metric change from period_a to period_b (absolute and percent) | |
| period_a | Yes | ||
| period_b | Yes |