Segment metrics
Choose the counts your teams see on every segment, on top of the UserPoint total.
Your goal
Add the counts that matter to your teams - reachable emails, known accounts, addressable cookies or mobile IDs - to every segment in a datamart, so nobody has to run a query to answer "how many of these users can I actually reach?".
Expected outcome
Segment listing and segment detail pages show your custom metrics alongside the UserPoint total, and the values are refreshed and kept as a history.
What a segment metric is
A segment metric is a custom metric offered on segments across a datamart. Metrics are visible on the segment listing and on segment detail pages, and the value of each metric is calculated regularly for every segment and saved, which gives you a historic view of how it evolves.
Segment metrics are configured per datamart and built on top of OTQL queries.
What each metric is made of
Query
An OTQL query returning a number.
Technical name
One of emails, user_accounts, desktop_cookie_ids, mobile_cookie_ids, mobile_ad_ids. Custom values are not allowed, and each value can be used only once per datamart.
Display name
The label shown in the interface.
Status
DRAFT, LIVE, or ARCHIVED.
Icon
Chosen from a fixed catalogue. Commonly used icons are display, users, email-inverted, and phone.
Set up a metric
Write and save the OTQL query
The query must return a number. Because every datamart has its own schema, test the query on the datamart concerned - in the Query Tool or by API - before you use it.
Common shapes:
The configured query is merged with the query of each segment to produce that segment's value, so write it as a datamart-wide count, not as a count for one segment.
Existing metrics can be listed with GET /v1/datamarts/:datamartId/audience_segment_metrics, and removed with DELETE /v1/datamarts/:datamartId/audience_segment_metrics/:metricId.
Lifecycle
A metric goes from DRAFT to LIVE, and from LIVE to ARCHIVED. An ARCHIVED metric cannot be republished - it can only be removed.
Limitations
10 custom metrics per datamart at most.
@cardinalityaggregations are not supported in metric queries.
See Platform limits for the other documented ceilings.
Troubleshooting
The metric is rejected on creation
The technical name is not one of the allowed values, or it is already used by another metric on the datamart.
The metric shows no value
The query does not return a number on this datamart's schema. Test it in the Query Tool first.
The value looks lower than expected
Metrics count UserPoints having at least one record, not records.
Publishing removed an existing metric
Publishing a metric archives the LIVE metric that shares its technical name.
Related pages
Last updated
Was this helpful?