Video Analytics API

Add the JavaScript tracking snippet to your page before your closing tag.

<!-- DVIDS Video Analytics -->
<script async src='https://cdn.dvidshub.net/js/DVIDSVideoAnalytics.min.js'></script>
<!-- End DVIDS Video Analytics -->

Events

Track events with:

DVIDSVideoAnalytics.track(name, properties);

Event names:

  • loaded: When video is initially loaded upon page load.
  • play: Specific document id to retrieve for search. Example: "image:123456". Required.
  • ended: Video has ended

Event properties:

  • domain (required): The domain of the site the video is loaded on (ex. wwww.dvidshub.net)
  • original_referrer: If you would like to provide the original referrer for the video landing page, provide it here.
  • type (required): Acceptable values: 'video' or 'webcast'.
  • type_id (required): The ID of the video or webcast being played from DVIDS.
  • unit: The unit ID the video belongs to.

Example for videojs on play event:

var analyticsParams = {
    domain: 'www.dvidshub.net',
    type_id: 762044,
    type:'video',
    original_referrer: '',
    unit: 1587
}

DVIDSVideoAnalytics.track('play', analyticsParams);