Skip to main content
Analytics endpoints share a large common set of filters. They combine with AND — a query filtered to countries and devices returns clicks matching both.

The filter set

Values are passed as JSON arrays:
get_org_metric_filter_values returns the values actually present in your data for a dimension. Use it to build filter menus rather than guessing at spellings — filters match what was recorded, and a country that never appears will quietly return zero rows.

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:
That is the batch endpoint telling you a filter you passed is not rollup-answerable. Split into individual 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

Query cost scales with the window. Thirteen months to render a thirty-day chart is thirteen times the work for the same picture.
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.
Yesterday’s totals will not change. Historical windows can be cached indefinitely; only ranges touching today need refreshing.
Narrowing with filters is cheaper than paging through everything and discarding rows client-side.

A composed query

Mobile traffic from the US that arrived from the newsletter, broken down by referrer, fifty rows at a time, bucketed in Eastern time.