This page covers data collection for the Ad length variable. See Ad length for the corresponding reporting dimension.
The ad length variable is the duration of the ad in seconds. Set it on every media.adStart event.
a.media.ad.lengthc_contextdata.a.media.ad.lengthRecommended implementation types
Set length inside xdm.mediaCollection.advertisingDetails when calling sendEvent:
| code language-javascript |
|---|
|
Pass the ad length in seconds as the fourth argument to createAdObject.
| code language-swift |
|---|
|
Pass the ad length in seconds as the fourth argument to createAdObject.
| code language-kotlin |
|---|
|
Set length inside xdm.mediaCollection.advertisingDetails when calling sendMediaEvent for media.adStart:
| code language-brightscript |
|---|
|
Call the adStart endpoint with length inside xdm.mediaCollection.advertisingDetails:
| code language-json |
|---|
|
Legacy implementation types (Analytics-only)
Pass the ad length in seconds as the fourth argument to ADB.Media.createAdObject:
| code language-javascript |
|---|
|
Pass the ad length in seconds as the fourth argument to ADBMobile.media.createAdObject:
| code language-javascript |
|---|
|
Pass the ad length in seconds as the fourth argument to adb_media_init_adinfo:
| code language-brightscript |
|---|
|
Include media.ad.length in the params object of your adStart POST request:
| code language-json |
|---|
|
See the Media Collection API events reference for the full request structure.