countries and devices returns clicks matching both.
The filter set
Values are passed as JSON arrays:
Two query engines
This is the part worth internalising, because it explains an error you will otherwise find baffling. Most queries are answered from pre-aggregated rollups: click counts already grouped by day and dimension. Fast, cheap, and what you get by default. Some filters cannot be answered from rollups, because the rollup does not carry that dimension. Those force a raw event scan — same results, slower on wide date ranges.get_org_metrics_batch exists specifically to fetch several dimensions in one rollup query, so it cannot fall back:
get_org_metrics_aggregation calls, which will take the raw path and succeed.
Note the shape:
status: "error" inside a 200 data envelope, not an error envelope. Check it explicitly if you use the batch endpoint.Keeping queries fast
Ask for the range you need
Ask for the range you need
Query cost scales with the window. Thirteen months to render a thirty-day chart is thirteen times the work for the same picture.
Batch when unfiltered
Batch when unfiltered
Four dimensions for a dashboard is one
get_org_metrics_batch call, not four round trips — as long as no raw-only filter is involved.Cache what does not move
Cache what does not move
Yesterday’s totals will not change. Historical windows can be cached indefinitely; only ranges touching today need refreshing.
Filter before paginating
Filter before paginating
Narrowing with filters is cheaper than paging through everything and discarding rows client-side.