Ad complete

The ad complete event signals that an individual ad finished playing. Send it after the ad plays to completion. If the viewer skips the ad, send Ad skip instead.

IMPORTANT
This event must be surrounded by adBreakStart and adBreakComplete bookends, even when a single ad plays. Without these bookends, ad events are ignored and the ad duration is counted as main content duration.
Web SDK

Call sendEvent with eventType: "media.adComplete":

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.adComplete",
    mediaCollection: {
      sessionID: "{sid}",
      playhead: 15
    }
  }
});
iOS

Call trackEvent with the AdComplete event type.

code language-swift
tracker.trackEvent(event: MediaEvent.AdComplete, info: nil, metadata: nil)
Android

Call trackEvent with the AdComplete event type.

code language-kotlin
tracker.trackEvent(Media.Event.AdComplete, null, null)
Roku

Call sendMediaEvent with eventType: "media.adComplete":

code language-brightscript
m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.adComplete",
        "mediaCollection": {
            "playhead": 15
        }
    }
})
Media Edge API

Call the adComplete endpoint:

code language-sh
curl -X POST "https://edge.adobedc.net/ee/va/v1/adComplete?configId={datastreamID}" \
--header 'Content-Type: application/json' \
--data '{
  "events": [{
    "xdm": {
      "eventType": "media.adComplete",
      "mediaCollection": {
        "sessionID": "{sid}",
        "playhead": 15
      },
      "timestamp": "YYYY-08-20T22:41:40+00:00"
    }
  }]
}'

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

Call trackEvent with the AdComplete event type:

code language-javascript
tracker.trackEvent(ADB.Media.Event.AdComplete, null, null);
Chromecast

Call trackEvent with the AdComplete event type:

code language-javascript
ADBMobile.media.trackEvent(ADBMobile.media.Event.AdComplete);
Media Collection API

Send an adComplete POST to the events endpoint:

code language-json
{
  "playerTime": { "playhead": 15, "ts": 1699523820000 },
  "eventType": "adComplete"
}
recommendation-more-help
media-analytics-help