Content channel

This page covers data collection for the Content channel variable. See Content channel for the corresponding reporting dimension.

The content channel variable identifies the distribution station, network, or property where the content plays. It is required for all streaming media implementations. Any string is accepted. Typical values include a network name, a portion of a site path, or an internal property identifier.

Property
Value
Context data variable
a.media.channel
XDM collection field
xdm.mediaCollection.sessionDetails.channel
Audience Manager trait
c_contextdata.a.media.channel
Required
Yes
Sent with
Session start, session close
Web SDK

Set channel inside xdm.mediaCollection.sessionDetails when calling sendEvent:

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        name: "video-123",
        length: 128,
        contentType: "vod",
        playerName: "HTML5 Player",
        channel: "Sports",
        streamType: "video"
      },
      playhead: 0
    }
  }
});
iOS

Set the channel through the tracker configuration when creating the tracker, using MediaConstants.TrackerConfig.CHANNEL. The channel is not part of the media object.

code language-swift
var config: [String: Any] = [:]
config[MediaConstants.TrackerConfig.PLAYER_NAME] = "HTML5 Player"
config[MediaConstants.TrackerConfig.CHANNEL] = "Sports"

Media.createTrackerWith(config: config) { tracker in
    self.tracker = tracker
}
Android

Set the channel through the tracker configuration when creating the tracker, using MediaConstants.TrackerConfig.CHANNEL. The channel is not part of the media object.

code language-kotlin
val config = HashMap<String, Any>()
config[MediaConstants.TrackerConfig.PLAYER_NAME] = "HTML5 Player"
config[MediaConstants.TrackerConfig.CHANNEL] = "Sports"

val tracker = Media.createTracker(config)
Roku

Set channel inside xdm.mediaCollection.sessionDetails when calling createMediaSession:

code language-brightscript
m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "name": "video-123",
                "length": 128,
                "contentType": "vod",
                "playerName": "Roku Player",
                "channel": "Sports",
                "streamType": "video"
            },
            "playhead": 0
        }
    }
})
Media Edge API

Call the sessionStart endpoint with channel inside xdm.mediaCollection.sessionDetails:

code language-json
{
  "events": [{
    "xdm": {
      "eventType": "media.sessionStart",
      "mediaCollection": {
        "sessionDetails": {
          "name": "video-123",
          "length": 128,
          "contentType": "vod",
          "playerName": "HTML5 Player",
          "channel": "Sports"
        },
        "playhead": 0
      }
    }
  }]
}

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

Set the channel on ADB.MediaConfig before creating the tracker:

code language-javascript
var mediaConfig = new ADB.MediaConfig();
mediaConfig.trackingServer = "your.tracking.server";
mediaConfig.playerName = "HTML5 Player";
mediaConfig.channel = "Sports";

var tracker = ADB.Media.getInstance(mediaConfig);
Chromecast

Pass channel as a standard metadata key when calling trackSessionStart:

code language-javascript
var mediaInfo = ADBMobile.media.createMediaObject("My Video", "video-123", 128,
  ADBMobile.media.StreamType.VOD, ADBMobile.media.MediaType.Video);
var metadata = { "a.media.channel": "Sports" };
ADBMobile.media.trackSessionStart(mediaInfo, metadata);
Media Collection API

Include media.channel in the params object of your sessionStart POST request:

code language-json
{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "sessionStart",
  "params": {
    "media.channel": "Sports"
  }
}

See the Media Collection API sessions reference for the full request structure.

recommendation-more-help
media-analytics-help