Developer
User guidesDeveloper websiteHelp centerLog in
  • Welcome!
  • Organisations structure
    • Datamart
    • Users and roles
  • User points
    • User identifiers
      • Networks IDs
        • Device-based Network IDs
          • Custom Device ID integration
          • ID5
          • First ID
        • User-based Network IDs
          • Custom User ID integration
          • UTIQ martechpass
      • Accounts
      • Emails
      • Device identifiers
    • User activities and events
    • Compartments
    • User profiles
    • User segments
    • Hyper point & Quarantine
  • Data model
    • Defining your schema
    • Computed fields
      • Concepts
      • Setup
      • Development
      • Examples
  • Data ingestion
    • Real time user tracking
      • Website tracking
      • Mobile apps tracking
      • Ads exposure tracking
      • AMP tracking
      • Conversions tracking
      • Email views and clicks
      • Tracking API
      • Event rules
      • Activity analyzers
    • Bulk processing
      • Imports
        • User activities import
        • User profiles import
        • User choices import
        • Segments import
      • Deletions
        • User identifiers deletion
        • Device points deletion
        • User points deletion
      • User identifiers association
      • Integration batch
    • Activities analytics
    • Data warehouse
      • Preliminary setup
        • BigQuery
      • Create data warehouse
  • Querying your data
    • OTQL queries
    • OTQL examples
    • GraphQL queries
    • UserPoint API
    • User activities
    • Activities analytics queries
      • API Quickstart
      • Dimensions and metrics
      • Use cases
    • Funnel API
  • Alerting
    • Alert configurations
  • Data visualisation
    • Quickstart
    • Dashboards
    • Sections and cards
    • Charts
    • Datasets and data sources
      • Using a data file data source
    • Transformations
    • Filters
    • Cookbook
    • Reference
  • Advanced usages
    • Audience segmentation
      • Audience features
      • Segment builders
      • Audience segment metrics
      • Audience segment feed
        • Building new feeds
        • Monitoring a feed
        • Curated Audiences (SDA)
      • Edge segments
      • Cohort-based Lookalike
    • Contextual targeting
      • Setup
      • Activation
        • Google Ad Manager
        • Xandr (through prebid.js)
      • API documentation
    • Exporting your data
      • Query Exports
      • Datamart replication
    • Data privacy compliance
      • User choices
      • Cleaning rules
      • Exercise of user rights
      • Cookies
    • Campaigns
    • Automations
      • Email routers
      • Email renderers
      • Opt-in provider
      • Custom action plugins
      • Usage limits for automations
    • Plugins
      • Concepts
      • Creation & Deployment
      • Coding your plugin
      • Manage existing plugins
      • Layouts
      • Presets
      • Monitoring
      • Throttling
      • Batching (for external feeds)
    • Platform monitoring
      • Resources usage
        • Dimensions and metrics
      • Collection volumes
        • Dimensions and metrics
      • Events ingestion monitoring
        • Dimensions and metrics
    • Data Clean Room
      • Bunker
      • Clean room
  • Resources
    • Tutorial: Data Ingestion
      • Your first events
        • Add the mediarithmics tag
          • Getting the tag
          • Adding the tag
        • Send events using the tag
          • Adding event properties
          • Finding the UserEvent type in your schema
          • Matching your schema
          • Standard events
      • Your first bulk imports
        • API basics
          • Authentication
          • Your first API call
        • Send documents using the API
          • Requirements
          • Sending documents
    • Using our API
      • Authentication
    • Tools & libraries
      • mics CLI
      • JS Tag
      • Plugin SDK
    • Data cubes
      • Creating a report
      • Reference
Powered by GitBook
On this page
  • How to configure metrics
  • Listing existing metrics
  • Create an audience metric
  • Activate the audience metric
  • Remove an audience metric
  • Limitations
  • Available icons
  • Most used icons
  • Other icons

Was this helpful?

Export as PDF
  1. Advanced usages
  2. Audience segmentation

Audience segment metrics

PreviousSegment buildersNextAudience segment feed

Last updated 3 years ago

Was this helpful?

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.

The total number of user points is always calculated and displayed, even if there are no custom metrics.

How to configure metrics

Audience segment metrics are configured per datamart and built on top of OTQL queries.

Each metric has:

  • 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.

Listing existing metrics

GET https://api.mediarithmics.com/v1/datamarts/:datamartId/audience_segment_metrics

Path Parameters

Name
Type
Description

datamartId

string

The ID of the datamart

{
    "status": "ok",
    "data": [
        {
            "id": "1555",
            "datafarm_key": "DF_EU_2020_02",
            "datamart_id": "1509",
            "query_id": "50659",
            "technical_name": "user_accounts",
            "display_name": "User Profiles",
            "icon": "users",
            "status": "LIVE",
            "creation_date": 1613125152462,
            "last_modified_date": 1613125152462,
            "last_published_date": null
        },
        {
            "id": "1558",
            "datafarm_key": "DF_EU_2020_02",
            "datamart_id": "1509",
            "query_id": "50659",
            "technical_name": "mobile_cookie_ids",
            "display_name": "User Profiles",
            "icon": "users",
            "status": "LIVE",
            "creation_date": 1613125314757,
            "last_modified_date": 1613125314757,
            "last_published_date": null
        },
        {
            "id": "1566",
            "datafarm_key": "DF_EU_2020_02",
            "datamart_id": "1509",
            "query_id": "50659",
            "technical_name": "mobile_ad_ids",
            "display_name": "User Profiles 7",
            "icon": "users",
            "status": "ARCHIVED",
            "creation_date": 1613128930707,
            "last_modified_date": 1613128930707,
            "last_published_date": null
        },
        {
            "id": "1569",
            "datafarm_key": "DF_EU_2020_02",
            "datamart_id": "1509",
            "query_id": "50659",
            "technical_name": "desktop_cookie_ids",
            "display_name": "User Profiles 4",
            "icon": "gears",
            "status": "LIVE",
            "creation_date": 1613129103522,
            "last_modified_date": 1613129103522,
            "last_published_date": null
        },
        {
            "id": "1570",
            "datafarm_key": "DF_EU_2020_02",
            "datamart_id": "1509",
            "query_id": "50659",
            "technical_name": "desktop_cookie_ids",
            "display_name": "User Profiles 4",
            "icon": "gears",
            "status": "DRAFT",
            "creation_date": 1613129261878,
            "last_modified_date": 1613129261878,
            "last_published_date": null
        }
    ],
    "count": 5,
    "total": 5,
    "first_result": 0,
    "max_result": 50,
    "max_results": 50
}

Create an audience metric

POST https://api.mediarithmics.com/v1/datamarts/:datamartId/audience_segment_metrics

This creates a DRAFT metric.

Path Parameters

Name
Type
Description

datamartId

integer

The ID of the datamart

Request Body

Name
Type
Description

Body

object

The metric you wish to create

{
    "status": "ok",
    "data": {
        "id": "1571",
        "datafarm_key": "DF_EU_2020_02",
        "datamart_id": "1509",
        "query_id": "50659",
        "technical_name": "emails",
        "display_name": "User Profiles 7",
        "icon": "users",
        "status": "DRAFT",
        "creation_date": 1613130322659,
        "last_modified_date": 1613130322659,
        "last_published_date": null
    }
}
{
    "status": "error",
    "error": "Json object is not structured as expected",
    "error_code": "BAD_REQUEST_FORMAT",
    "error_id": "e18c26a1-7497-470d-8480-2bcb66fc8f16"
}

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"
}

Activate the audience metric

POST https://api.mediarithmics.com/v1/datamarts/:datamartId/audience_segment_metrics/:metricId/action

This action transitions the metric go from DRAFT to LIVE.status. Any existing metric in LIVE status with the same technical name is ARCHIVED.

Path Parameters

Name
Type
Description

datamartId

integer

The ID of the datamart

metricId

integer

The ID of the metric to publish

Request Body

Name
Type
Description

Body

object

{ "action": "PUBLISH" }

Remove an audience metric

DELETE https://api.mediarithmics.com/v1/datamarts/:datamartId/audience_segment_metrics/:metricId

Path Parameters

Name
Type
Description

datamartId

integer

The ID of the datamart

metricId

integer

The ID of the metric to remove

Limitations

  1. Only five custom audience segment metrics per datamart are allowed—one per available technical name.

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

An associated

You must first 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.

are not supported in the queries.

Segment details page on a datamart with 2 custom audience segment metrics
A segment view without custom metrics
OTQL Query
create an OTQL query,
@cardinality aggregations