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 #80 from Financial-Times/analytics-docs
Browse files Browse the repository at this point in the history
Documented the video analytics
  • Loading branch information
commuterjoy authored Jan 5, 2017
2 parents 8651a08 + 8586e34 commit 17c0a1e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions analytics.md
Original file line number Diff line number Diff line change
@@ -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
}
```

0 comments on commit 17c0a1e

Please sign in to comment.