Chapter name

This page covers data collection for the Chapter name variable. See Chapter name for the corresponding reporting dimension.

The chapter name variable is the human-readable title of a chapter (for example, "Pilot Episode - Opening"). Set it on every media.chapterStart event whose content is divided into chapters.

Property
Value
Context data variable
a.media.chapter.friendlyName
XDM collection field
mediaCollection.chapterDetails.friendlyName
Required
No
Sent with
Chapter start, chapter close

Web SDK

Set friendlyName inside mediaCollection.chapterDetails when calling sendEvent:

alloy("sendEvent", {
  xdm: {
    eventType: "media.chapterStart",
    mediaCollection: {
      chapterDetails: {
        friendlyName: "Pilot Episode - Opening",
        index: 1,
        offset: 0,
        length: 240
      },
      sessionID: "{sid}",
      playhead: 0
    }
  }
});

Mobile SDK

Pass the chapter name as the first (name) argument to createChapterObject.

iOS (Swift)

let chapterObject = Media.createChapterObjectWith(name: "Pilot Episode - Opening",
                                              position: 1,
                                                length: 240,
                                             startTime: 0)

tracker.trackEvent(event: MediaEvent.ChapterStart, info: chapterObject, metadata: nil)

Android (Kotlin)

val chapterObject = Media.createChapterObject("Pilot Episode - Opening",
                                              1L,
                                              240.0,
                                              0.0)

tracker.trackEvent(Media.Event.ChapterStart, chapterObject, null)

Roku (BrightScript)

Set friendlyName inside mediaCollection.chapterDetails when calling sendMediaEvent for media.chapterStart:

m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.chapterStart",
        "mediaCollection": {
            "chapterDetails": {
                "friendlyName": "Pilot Episode - Opening",
                "index": 1,
                "offset": 0,
                "length": 240
            },
            "playhead": 0
        }
    }
})

Media Edge API

Call the chapterStart endpoint with friendlyName inside mediaCollection.chapterDetails:

{
  "events": [{
    "xdm": {
      "eventType": "media.chapterStart",
      "mediaCollection": {
        "chapterDetails": {
          "friendlyName": "Pilot Episode - Opening",
          "index": 1,
          "offset": 0,
          "length": 240
        },
        "sessionID": "{sid}",
        "playhead": 0
      }
    }
  }]
}

Media SDK

Pass the chapter name as the first argument to ADB.Media.createChapterObject:

var chapterInfo = ADB.Media.createChapterObject(
  "Pilot Episode - Opening",  // name
  1,                          // position
  240,                        // length (seconds)
  0                           // start time (seconds)
);

tracker.trackEvent(ADB.Media.Event.ChapterStart, chapterInfo, contextData);

Media Collection API

Include media.chapter.friendlyName in the params object of your chapterStart POST request:

{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "chapterStart",
  "params": {
    "media.chapter.friendlyName": "Pilot Episode - Opening"
  }
}

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

recommendation-more-help
media-analytics-help