A wrapper aroundDocumentation Index
Fetch the complete documentation index at: https://docs.cometly.com/llms.txt
Use this file to discover all available pages before exploring further.
query_ad_metrics that runs the query twice — current period and the comparison period — and returns both row sets plus a per-metric delta and percent-change. Avoids the double-round-trip of two separate calls.
When to use
- “How did last week compare to the week before?”
- “Is CPA down vs last month?”
- WoW / MoM / YoY questions.
query_attribution_models. For point-in-time queries, use query_ad_metrics.
Parameters
Accepts every parameterquery_ad_metrics does, plus:
| Parameter | Type | Required | Description |
|---|---|---|---|
compare_to | string | No | previous_period (default), previous_year, or custom. |
previous_date_start | string | Conditional | Required when compare_to=custom. YYYY-MM-DD. |
previous_date_end | string | Conditional | Required when compare_to=custom. YYYY-MM-DD. |
this_*presets map to theirlast_*counterparts (this_week→last_week, etc.).- Trailing windows (
last_7_days,last_30_days, …) shift the same span backward. - Custom date ranges with
compare_to: previous_yearsubtract 365 days from both bounds.
Output
pct_change is null when the previous-period value is 0 (avoids divide-by-zero).