Audience segment metrics
Audience segment metrics are a way to offer custom metrics on segments to users. They are visible on the segment listing and segment details pages.
The value of each metric is calculated regularly for each segment and saved to offer a historic view of its values.
Segment details page on a datamart with 2 custom audience segment metrics
The total number of user points is always calculated and displayed, even if there are no custom metrics.
A segment view without custom metrics

How to configure metrics

Audience segment metrics are configured per datamart and built on top of OTQL queries.
Each metric has:
  • An associated OTQL Query
  • A technical name, possible values being emails, user_accounts, desktop_cookie_ids, mobile_cookie_ids or mobile_ad_ids. You can't use a custom value, and each of these values can only be used once per datamart.
  • A display name shown in the UI
  • A status: DRAFT, LIVE or ARCHIVED.
  • An icon, from a set of possible icons.
The metrics calculate how many user points in the segment have at least one record. It doesn't count the number of records in the segment.
If you add a metric that counts the number of cookies and a user point is associated with multiple cookies in the platform, it will be counted as only a +1 and not a +2.
The metrics values will always be lower or equal to the number of user points in the segment.
A metric goes from DRAFT status to LIVE and from LIVE status to ARCHIVED. You cannot republish an ARCHIVED metric. You can only remove it.
get
https://api.mediarithmics.com
/v1/datamarts/:datamartId/audience_segment_metrics
Listing existing metrics
post
https://api.mediarithmics.com
/v1/datamarts/:datamartId/audience_segment_metrics
Create an audience metric
You must first create an OTQL query, returning a number corresponding to your metric. As each datamart can have its very own schema, those queries should be tested for each datamart (by API or in the Data Studio) and should return a number. The configured query will be "merged" with the query of each segment to calculate the proper metric.
Here are some common query examples:
  • SELECT @count{id} FROM UserPoint WHERE agents{} counts the number of user points having at least 1 cookie or mobile ID (user agent)
  • SELECT @count{id} FROM UserPoint WHERE profiles{} counts the number of user points having at least 1 profile
  • SELECT @count{id} FROM UserPoint WHERE emails{} counts the number of user points having at least 1 email
Here is a sample body payload:
{
"datamart_id": "<<DATAMART ID>>",
"query_id": "<OTQL QUERY ID>",
"technical_name": "<TECHNICAL_NAME>",
"display_name": "User Profiles",
"icon": "users"
}
post
https://api.mediarithmics.com
/v1/datamarts/:datamartId/audience_segment_metrics/:metricId/action
Activate the audience metric
delete
https://api.mediarithmics.com
/v1/datamarts/:datamartId/audience_segment_metrics/:metricId
Remove an audience metric

Limitations

  1. 1.
    Only five custom audience segment metrics per datamart are allowed—one per available technical name.
  2. 2.
    @cardinality aggregations are not supported in the queries.

Available icons

Each metric is associated with an icon taken from the following catalogue.

Most used icons

  • display
  • users
  • email-inverted
  • phone

Other icons

  • adGroups
  • ads
  • automation
  • bell
  • bolt
  • check-rounded-inverted
  • check-rounded
  • check
  • chevron-right
  • chevron
  • close-big
  • close-rounded
  • close
  • code
  • creative
  • data
  • delete
  • display
  • dots
  • download
  • email-inverted
  • email
  • extend
  • filters
  • full-users
  • file
  • gears
  • goals-rounded
  • goals
  • image
  • info
  • laptop
  • library
  • magnifier
  • menu-close
  • minus
  • optimization
  • options
  • partitions
  • pause
  • pen
  • phone
  • play
  • plus
  • query
  • question
  • refresh
  • settings
  • smartphone
  • status
  • tablet
  • user
  • users
  • user-query
  • user-pixel
  • user-list
  • video
  • warning
Copy link
On this page
How to configure metrics
get
Listing existing metrics
post
Create an audience metric
post
Activate the audience metric
delete
Remove an audience metric
Limitations
Available icons
Most used icons
Other icons