Contact Support | System Status
Page Contents

    Data Collection API Sample

    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.

    Limitations

    CodePen

    Source code

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

    Sample app

    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 adds 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

    Page last updated on 19 Jun 2021