diff --git a/analytics.md b/analytics.md index 83bcfc1..5048d14 100644 --- a/analytics.md +++ b/analytics.md @@ -6,6 +6,7 @@ An overview of the o-video analytics. The advert events are fired by the [Google IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type). +- adRequested - The request to the ad server has been made. - adStart - The advert started. - adComplete - The advert finished (i.e. played through to the end). - adSkippable - The advert is skippable, fired when the state changes to skippable. diff --git a/src/js/ads.js b/src/js/ads.js index 48f10c4..bccf1c2 100644 --- a/src/js/ads.js +++ b/src/js/ads.js @@ -128,6 +128,17 @@ class VideoAds { adsRequest.nonLinearAdSlotWidth = 592; adsRequest.nonLinearAdSlotHeight = 150; + // Temporary fix to verify DFP behaviour + const options = { + category: 'video', + action: 'adRequested', + detail: { + contentId: this.video.opts.id + } + }; + const requestedEvent = new CustomEvent('oTracking.event', options); + document.body.dispatchEvent(requestedEvent); + this.adsLoader.requestAds(adsRequest); }