Posizione del capitolo

Questa pagina contiene informazioni sulla raccolta dati per la variabile Chapter position. Vedi Posizione capitolo per la dimensione di reporting corrispondente.

La variabile di posizione del capitolo è l’indice del capitolo all’interno del contenuto, a partire da 1 (tipico) o 0 (a seconda della convenzione). Utilizza un indice stabile per capitolo in modo che lo stesso capitolo venga aggregato tra le sessioni.

Proprietà
Valore
Variabile di dati di contesto
a.media.chapter.position
Campo raccolta XDM
xdm.mediaCollection.chapterDetails.index
Caratteristica Audience Manager
c_contextdata.a.media.chapter.position
Obbligatorio
No (Mobile SDK); Sì (Edge, Media Collection API)
Inviato con
Inizio capitolo, chiusura capitolo

Tipi di implementazione consigliati

Web SDK

Imposta index all’interno di xdm.mediaCollection.chapterDetails quando chiama sendEvent:

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

Passa la posizione del capitolo come secondo argomento a createChapterObject.

code language-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

Passa la posizione del capitolo come secondo argomento a createChapterObject.

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

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

Imposta index in xdm.mediaCollection.chapterDetails quando chiama sendMediaEvent per media.chapterStart:

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

Chiama l’endpoint chapterStart con index in xdm.mediaCollection.chapterDetails:

code language-json
{
  "events": [{
    "xdm": {
      "eventType": "media.chapterStart",
      "mediaCollection": {
        "chapterDetails": {
          "index": 1,
          "offset": 0,
          "length": 240
        },
        "sessionID": "{sid}",
        "playhead": 0
      }
    }
  }]
}

Tipi di implementazione legacy (solo Analytics)

Media SDK JS 3.x

Passa la posizione del capitolo come secondo argomento a ADB.Media.createChapterObject:

code language-javascript
var chapterInfo = ADB.Media.createChapterObject(
  "Pilot Episode - Opening",
  1,
  240,
  0
);

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

Passa la posizione del capitolo come secondo argomento a ADBMobile.media.createChapterObject:

code language-javascript
var chapterInfo = ADBMobile.media.createChapterObject(
  "Pilot Episode - Opening",  // name
  1,                          // position
  240,                        // length
  0                           // startTime
);
ADBMobile.media.trackEvent(ADBMobile.media.Event.ChapterStart, chapterInfo, null);
API Media Collection

Includi media.chapter.index nell’oggetto params della richiesta POST chapterStart:

code language-json
{
  "playerTime": { "playhead": 0, "ts": 1699523820000 },
  "eventType": "chapterStart",
  "params": {
    "media.chapter.index": 1
  }
}

Per la struttura completa delle richieste, consulta il Riferimento eventi API di Media Collection.

recommendation-more-help
media-analytics-help