From 6051c13a80e0b22befe35535771b48a124fb7ac0 Mon Sep 17 00:00:00 2001 From: Matt Chadburn Date: Wed, 4 Jan 2017 16:34:25 +0000 Subject: [PATCH 1/2] Documented analytics --- analytics.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 analytics.md diff --git a/analytics.md b/analytics.md new file mode 100644 index 0000000..26a45f6 --- /dev/null +++ b/analytics.md @@ -0,0 +1,52 @@ +# Video analytics + +An overview of the o-video analytics. + +## Adverts events + +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). + +- 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. +- adSkip - The user skipped the advert. + +Each event comes with extra detail. + +```js +detail: { + advertising: true, + category: 'video', + contentId: this.video.opts.id, + progress: 0, + adDuration: ad.getDuration(), + adMinDuration: ad.getMinSuggestedDuration(), + adTitle: ad.getTitle(), + adProgress: this.getAdProgress() +} +``` + +More details of the `ad` API calls are in the [IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis). + +## Video events + +The video events are fired as part of the (native HTML Media Events API)[https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events]. + +- playing - The video started playing. +- progress - The video played through to a particular waypoint, defaults to firing events at ~25/50/75/100% progress. +- ended - The video played through to the end +- seeked - The user jumped to a point in the video. +- pause - The user paused the video. + +Each event has the following additional properties, + +```js +detail: { + action: ev.type, + advertising: video.opts.advertising, + category: 'video', + contentId: video.opts.id, + progress: video.getProgress(), + duration: video.videoEl.duration +} +``` From 8586e34e1f47807b3627d8d323d820be3ba2786b Mon Sep 17 00:00:00 2001 From: Matt Chadburn Date: Wed, 4 Jan 2017 17:20:28 +0000 Subject: [PATCH 2/2] Fix markdown --- analytics.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/analytics.md b/analytics.md index 26a45f6..83bcfc1 100644 --- a/analytics.md +++ b/analytics.md @@ -15,22 +15,22 @@ Each event comes with extra detail. ```js detail: { - advertising: true, - category: 'video', - contentId: this.video.opts.id, - progress: 0, - adDuration: ad.getDuration(), - adMinDuration: ad.getMinSuggestedDuration(), - adTitle: ad.getTitle(), - adProgress: this.getAdProgress() + advertising: true, + category: 'video', + contentId: this.video.opts.id, + progress: 0, + adDuration: ad.getDuration(), + adMinDuration: ad.getMinSuggestedDuration(), + adTitle: ad.getTitle(), + adProgress: this.getAdProgress() } ``` -More details of the `ad` API calls are in the [IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis). +More details of the `ad.*` API calls are in the [IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis). ## Video events -The video events are fired as part of the (native HTML Media Events API)[https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events]. +The video events are fired as part of the [native HTML Media Events API](https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events). - playing - The video started playing. - progress - The video played through to a particular waypoint, defaults to firing events at ~25/50/75/100% progress. @@ -42,11 +42,11 @@ Each event has the following additional properties, ```js detail: { - action: ev.type, - advertising: video.opts.advertising, - category: 'video', - contentId: video.opts.id, - progress: video.getProgress(), - duration: video.videoEl.duration + action: ev.type, + advertising: video.opts.advertising, + category: 'video', + contentId: video.opts.id, + progress: video.getProgress(), + duration: video.videoEl.duration } ```