Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cometly.com/llms.txt

Use this file to discover all available pages before exploring further.

A wrapper around query_ad_metrics that pre-filters to conversion metrics (counts + amounts) and curates the group_by surface to “time + source” type dimensions agents actually want here.

When to use

  • “Daily purchase count last 30 days.”
  • “Sum of revenue by ad source last week.”
  • Any question that wants a TOTAL or BUCKET, not individual rows.
For per-event rows use list_events. For ad-spend / ROAS metrics use query_ad_metrics directly.

Parameters

ParameterTypeRequiredDescription
date_rangestringYesDateRange preset.
attribution_modelstringYes
attribution_windowintegerYes
attribution_window_typestringYesrelative or absolute.
event_namesstring[]YesEvent slugs OR human labels. Both work — the LabelResolver normalizes.
group_bystring[]NoBucketing dimensions. Default: ["day"]. Valid: day, week, month, quarter, year, sources, country, state, city, device_type, browser, os, campaign_name, adset_name, ad_name.
date_start / date_endstringConditionalWhen date_range=custom.
sourcesstring[]NoRestrict to traffic sources.
filtersobjectNoSame filter shape as query_ad_metrics.
formatstringNocsv (default), json, or yaml.

Output

CSV with <group_by columns>, <event_count>, <event_amount> rows:
day,Deal Created,Deal Created_amount,purchase,purchase_amount
2026-05-08,12,4200,87,8240
2026-05-09,15,5300,92,8830
# label_map: custom_event_2=Deal Created appears in the footer when custom events were used.