Show type

This page covers data collection for the Show type variable. See Show type for the corresponding reporting dimension.

The show type variable identifies the content format using a string integer code:

  • "0": Full episode
  • "1": Preview or trailer
  • "2": Clip
  • "3": Other

Use it to separate full-program viewing from short-form content like trailers and clips when measuring engagement.

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

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

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.sessionStart",
    mediaCollection: {
      sessionDetails: {
        showType: "0"
      },
      playhead: 0
    }
  }
});
iOS

Pass the show type as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.SHOW_TYPE.

code language-swift
var metadata: [String: String] = [:]
metadata[MediaConstants.VideoMetadataKeys.SHOW_TYPE] = "0"

tracker.trackSessionStart(info: mediaObject, metadata: metadata)
Android

Pass the show type as a metadata key in the HashMap argument to trackSessionStart. Use MediaConstants.VideoMetadataKeys.SHOW_TYPE.

code language-kotlin
val metadata = HashMap<String, String>()
metadata[MediaConstants.VideoMetadataKeys.SHOW_TYPE] = "0"

tracker.trackSessionStart(mediaInfo, metadata)
Roku

Use createMediaSession to set showType inside sessionDetails:

code language-brightscript
m.aepSdk.createMediaSession({
    "xdm": {
        "eventType": "media.sessionStart",
        "mediaCollection": {
            "sessionDetails": {
                "showType": "0"
            },
            "playhead": 0
        }
    }
})
Media Edge API

Call the sessionStart endpoint with showType 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",
          "showType": "0"
        },
        "playhead": 0
      }
    }
  }]
}

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

Pass the show type in the contextData object using ADB.Media.VideoMetadataKeys.ShowType:

code language-javascript
var contextData = {};
contextData[ADB.Media.VideoMetadataKeys.ShowType] = "0";

tracker.trackSessionStart(mediaInfo, contextData);
Chromecast

Use ADBMobile.media.VideoMetadataKeys.SHOW_TYPE to set the show type in the StandardMediaMetadata property of the media object before calling trackSessionStart:

code language-javascript
var mediaInfo = ADBMobile.media.createMediaObject("My Video", "video-123", 128,
  ADBMobile.media.StreamType.VOD, ADBMobile.media.MediaType.Video);
var standardMetadata = {};
standardMetadata[ADBMobile.media.VideoMetadataKeys.SHOW_TYPE] = "0";
mediaInfo[ADBMobile.media.MediaObjectKey.StandardMediaMetadata] = standardMetadata;
ADBMobile.media.trackSessionStart(mediaInfo, null);
Media Collection API

Include media.showType in the params object:

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

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

recommendation-more-help
media-analytics-help