Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #82 from Financial-Times/more-advert-stats
Browse files Browse the repository at this point in the history
Log DFP advert requested in Spoor
  • Loading branch information
ironsidevsquincy authored Jan 24, 2017
2 parents a6e35d1 + 235f227 commit d0520e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions src/js/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d0520e7

Please sign in to comment.