Data Collection API Sample

Product(s)
Video Cloud
Role(s)
API Developer
Device SDK Developer
Topic(s)
Analytics
Code Samples
API(s)
Analytics API

In this sample, you will learn how to send information to the Data Collector so that you can get analytics data for videos that are not viewed in a Brightcove web or SDK player. Note that this technique should not be used if you are using the Brightcove web or SDK players, as it will result in duplicated analytics data.

This sample shows how to send analytics data to the Brightcove Data Collector from a non-Brightcove player (in this case, the Video.js player).

CodePen

Find all the code associated with this sample in this GitHub repository.

See the Pen Collection API Sample by Brightcove Learning Services (@rcrooks1969) on CodePen.

Using the CodePen

Here are some tips to effectively use the above CodePen:

  • Toggle the actual display of the player by clicking the Result button.
  • Click the HTML/CSS/JS buttons to display ONE of the code types.
  • Click Edit on CodePen in the upper right corner to fork this CodePen into your own account.
  • Find all the code associated with this sample in this GitHub repository.

Notes on the sample

The code for this sample is all JavaScript, and there are two parts (both found in the CodePen: the plugin script is at the top, and a short piece of code that addes the plugin to the player at the bottom):

  • The script that adds the plugin to the videojs player
  • The script for the plugin that sends data to the Data Collector