query_ad_metrics.
When to use
- “Show me yesterday’s purchases.”
- “List sign-ups from Google Ads last week.”
- “What were the most recent leads attributed to Facebook?”
- “List purchases from contacts where Customer Plan is Premium this month.”
Parameters
Custom field filters
custom_field_filters is a flat array of conditions, ANDed together. Each condition references a custom profile field configured on your Space:
validation_error.
Operator vocabulary by field type
any matches contacts where the field has a value; unknown matches contacts where the field is empty or unset. For numeric fields, any requires a value greater than 0 and unknown matches 0 or unset. Date comparisons (equal_to, greater_than, less_than, between) use your space’s configured timezone; equal_to matches the full calendar day.
Attribution behavior
Withoutsources, you get one row per event in the date range — no attribution.
With sources, multi-touch attribution applies and each event may return multiple rows — one per attributed touchpoint. A 25. Single-touch models (first_touch, last_touch) return one row per event.
Example response
Caveats
- Default fields are minimal (
id,event_time_utc) to keep responses fast. Ask for more viafieldswhen you actually need them. - Touchpoint fields require sources. Asking for
ad_namewithout settingsourcesreturns a validation error. event_urlis computed frommetadata.host + path + query— useful for “what page did this fire from?” questions.not_equal_to/not_containsexclude unset values. Contacts where the field is unset are not included. Add a separateunknowncondition if you need to capture those.