PrebidJS – Manage custom ad unit events with prebid js integration

How can I manage custom events that are emitted by ad unit itself. Can I catch them in Analytic Adapter? How to emit them correctly?

For example, ad unit emits event inside iframe:

window.parent.dispatchEvent(
     new CustomEvent({ name: 'videoPlayed', payload })
)

Can I somehow get it in the customAnalyticAdapter:

Object.assign(adapter({ url, analyticsType }), {
track: function(event) {
    case videoPlayed:
         // Send to Custom Tracker Server
}
}

I didn’t find any solution.

Leave a Comment