This page covers data collection for the Ad ID variable. See Ad for the corresponding reporting dimension.
The ad ID variable uniquely identifies each ad. It is required for every ad that your player tracks. Set it on every media.adStart event.
a.media.ad.namec_contextdata.a.media.ad.nameRecommended implementation types
Set name inside xdm.mediaCollection.advertisingDetails when calling sendEvent for media.adStart:
| code language-javascript |
|---|
|
Pass the ad ID as the adId argument to createAdObject. The first argument (name) is the friendly name; the second is the ID.
| code language-swift |
|---|
|
Pass the ad ID as the adId argument to createAdObject. The first argument (name) is the friendly name; the second is the ID.
| code language-kotlin |
|---|
|
Set name inside xdm.mediaCollection.advertisingDetails when calling sendMediaEvent for media.adStart:
| code language-brightscript |
|---|
|
Call the adStart endpoint with name inside xdm.mediaCollection.advertisingDetails:
| code language-json |
|---|
|
Legacy implementation types (Analytics-only)
Pass the ad ID as the second argument to ADB.Media.createAdObject:
| code language-javascript |
|---|
|
Pass the ad ID as the second argument to ADBMobile.media.createAdObject:
| code language-javascript |
|---|
|
Include media.ad.id in the params object of your adStart POST request:
| code language-json |
|---|
|
See the Media Collection API events reference for the full request structure.