Brightcove Smart Video Measurement
This post is part of an on-going series on video measurement tips, tricks, and best practices.
Brightcove is a popular video platform that offers solutions for publishing and distribution of digital media. Adobe has partnered with Brightcove to provide video measurement solutions for the Brightcove video players. If you are a Brightcove customer, bringing video playback data into your general site and app analytics is critical to seeing a complete picture of your content consumption and monetization. http://www.brightcove.com/en/
In order to implement video analytics for your Brightcove video player, you will need the following items:
Access to s_code.js file: This solution requires the addition of code within the s_code.js file.
Ability to add code to your site: In addition to s_code changes, you may also need to modify the video player code.
Brightcove Account with Admin Access: The solution requires some settings to be made within the Brightcove Video Cloud administration.
A current s_code version: The solution requires H code version H24 for higher.
I am not going to cover the measurement plan here, but I strongly encourage you to map out what aspects of video playback you need to capture and select the SiteCatalyst variables you will use before you start modifying your code. A measurement plan will help with implementation and provide documentation into the future.
There are three steps to the Brightcove player mapping: modifying the settings within the Video Cloud, calling the video player correctly on your page, and adding the Brightcove Smart Analytics plug-in to your s_code file.
Once the player settings are correct, edit the page level code used to call the Brighcove video player. The page level code needs to call the BrightcoveExperiences.js file. Two additional parameters must also be set within the player object, the includeAPI and the templateLoadHandler. See the page level code within the sample player.
Next, add the Brightcove Smart Plug-in to your s_code file within the plug-ins area. The plug-in code maps the Brightcove player events to the SiteCatalys Media Module functions. The code can be grabbed from the sample player’s s_code file.
Pay careful attention to the notes found within the code. The video title and player name are both required variables but can be modified to match your desired formatting and values. The plug-in code contains optional variables for Brightcove meta-data, which can be commented out if the meta-data is not part of your measurement plan. This is also the best location for adding additional meta-data points.
With the plug-in code in place, the Media Module functions will fire when specific player events occur. The final implementation step is to add the video variable mapping to your s_code file. Follow your measurement plan for the proper frequency and variable usage. In the sample player I am setting quartiles and adding all the plug-in meta-data points.
A few things to note about this sample code:
Enable Video Tracking: I recommend wrapping the variable mapping in a true/false variable. In this example I am using s.enableVideoTracking. This allows a developer to easily turn on and off the video tracking and also contains the variable mapping within one function.
Track Vars: Make sure to include all the variables and events in the s.Media.trackVars and s.Media.trackEvents variables or the variables may not show up in your tracking calls.
Auto Track: s.Media.autoTrack is set to false because we added player specific event listeners in the player mapping code.
After completing implementation, load your files into a browser and use a packet sniffer to check the tracking calls. You should see two groups of context data variables; a.media is for the default video tracking variables and bc_ is for the Brightcove plug-in variables. All the context variables can be mapped to SiteCatalyst variables by using the processing rules within SiteCatalyst.
This Brightcove plug-in is a new solution and is being actively improved by Adobe and Brightcove. Right now, there is a known bug with buffering. If the video begins to buffer, the media module timer may get out of sync with the video player head. This can cause the video complete event to fire before the video has completed playback. Additionally, the video player name is currently static and must be set within the s_code. In future releases, the video player name will be pulled from the Brightcove meta-data.
If you add new meta-data hooks to this solution or make other changes, please leave a comment. This will help us continue to improve the solution.