Ads exposure tracking
Bring ad views and clicks into your datamart with pixels and click-tracking URLs.
Your goal
Get the exposure of your users to display and video ads into your own datamart, so impressions and clicks sit on the same timeline as your site and CRM data.
Expected outcome
$ad_view and $ad_click events arriving from your DSP or ad server, carrying the campaign, ad group, and creative identifiers you can report on.
What you can track
Display ads
Static images, animations, and HTML5 animated ads.
Video ads
Video ads the user sees through a marketing campaign.
All ads tracking is done with pixels and click-tracking URLs.
$ad_view
Pixel
The view or impression of the ad by the user.
$ad_click
Click-tracking URL
The click on the ad by the user.
The display ad pixel
https://events.mediarithmics.com/v1/touches/pixel?
$ev=$ad_view&
$dat_token=<DATAMART_TOKEN>&
$catn=<CAMPAIGN_TECHNICAL_NAME>&
$scatn=<AD_GROUP_TECHNICAL_NAME>&
$crtn=<CREATIVE_TECHNICAL_NAME>&
$cb=<CACHEBUSTER>&
gdpr=<GDPR>&
gdpr_consent=<GDPR_CONSENT_184>
<any custom property>The click-tracking URL
Parameters
$ev
String
The event name: $ad_view for impressions, $ad_click for clicks.
$dat_token
String
The token of the datamart - not the ID.
$catn
String
Campaign technical name.
$scatn
String
Sub-campaign - ad group - technical name.
$crtn
String
Creative technical name.
$redirect
String
Clicks only. The redirect URL, URL-encoded (RFC 3986).
$cb
String, optional
Cache buster - a random string.
$cuid
String
The user account identifier.
$comp_token
String
The compartment token - not the ID.
$email_hash
String
The user's email hash.
$uaid
String
The mobile identifier of the user, identifying the user agent. Pixel only.
$uids
JSON as string, optional
A list of user identifiers - see below.
gdpr
Number
TCF v2.2 parameter indicating whether GDPR applies: 1 or 0.
gdpr_consent
String
TCF v2.2 parameter containing the encoded consent string.
any custom property
Any, optional
A custom property.
Passing user identifiers with $uids
This applies to all pixel-based tracking that uses the events.mediarithmics.com/v1/touches/pixel endpoint - ads, email, conversions.
$uids carries one or more identifiers as a JSON array:
The jso- prefix means the rest of the string is interpreted as a JSON object. Encode the URL correctly.
$tpe
Constant string
AC
$ctok
String
The token of the compartment.
$acid
String
The user account ID.
$tpe
Constant string
EM
$eh
String
The email hash.
$e
String, optional
The raw email.
$tpe
Constant string
AG
$agid
String
The user agent ID.
Platform integrations
To integrate with an external DSP or ad server, use the IDs of the creative, ad group, and campaign from that platform as the technical names. Each platform exposes them as macros.
Additional properties can be tracked as custom properties:
Each platform documents its own macro list; use it to confirm the exact macro names before going live.
Video ads
Basic video ad tracking is achieved by integrating the display ad pixel with $ad_view events and the click-tracking URL with $ad_click events into your video ad format.
For more advanced capabilities, a specific integration can be set up based on the visit pixel with custom completion events, plus an activity analyzer. Discuss this with your account representatives during the design phase.
Verify
$ad_viewand$ad_clickevents appear with$typeDISPLAY_AD.Campaign, ad group, and creative technical names are populated, not left as raw macros - an unresolved
%%MACRO%%in the stored data means the platform did not substitute it.Clicks redirect correctly.
Custom properties you rely on are indexed in the schema.
Related pages
Last updated
Was this helpful?