This page covers data collection for the Content length variable. See Content length for the corresponding reporting dimension.
The content length variable is the total duration of the content in seconds. It is required for all streaming media implementations and must be set at session start. Content length drives several backend-computed metrics, including progress markers (10/25/50/75/95%) and Average Minute Audience. If content length is not set, or is not greater than zero, those metrics are not produced. For live streams with unknown duration, use 86400 (24 hours).
a.media.lengthc_contextdata.a.media.lengthRecommended implementation types
Set length inside xdm.mediaCollection.sessionDetails when calling sendEvent:
| code language-javascript |
|---|
|
Pass the content length in seconds as the length argument to createMediaObject.
| code language-swift |
|---|
|
Pass the content length in seconds as the length argument to createMediaObject.
| code language-kotlin |
|---|
|
Set length inside xdm.mediaCollection.sessionDetails when calling createMediaSession:
| code language-brightscript |
|---|
|
Call the sessionStart endpoint with length inside xdm.mediaCollection.sessionDetails:
| code language-json |
|---|
|
Legacy implementation types (Analytics-only)
Pass the content length in seconds as the third argument to ADB.Media.createMediaObject:
| code language-javascript |
|---|
|
Pass the content length in seconds as the third argument to ADBMobile.media.createMediaObject:
| code language-javascript |
|---|
|
Include media.length in the params object of your sessionStart POST request:
| code language-json |
|---|
|
See the Media Collection API sessions reference for the full request structure.