JW Player Video Measurement

JWPlayerLogojwplayer-6JW Player is a popular video platform that offers solutions for publishing and distribution of digital media. If you are a JW Player customer and an Adobe Analytics customer, bringing video playback data into your site and app analytics is critical to seeing a complete picture of your content consumption and monetization. http://www.jwplayer.com/

The JW Player Video Player Mapping covered in this post utilizes the JW Player 6.12 API library and the Adobe Analytics AppMeasurement 1.4.4 JS to provide a JavaScript based solution for tracking JW Player video. This solution is for use with the Adobe Analytics legacy Milestone video solution, not for the Video Heartbeat measurement. I will be posting a JW Player Heartbeat solution in the coming weeks.

The code facilitates the collection of analytics data for both Flash and HTLM5 JW Player video players. The solution relies on page and site level JavaScript, which means tracking may not be available on viral or shared video player instances placed outside your web sites. You can find a sample player running the script here: http://video.marijka.com/milestone/jwplayer.html

Getting Started
In order to imple­ment video ana­lyt­ics for your JW Player you will need the fol­low­ing items:
Access to Adobe Analytics JavaScript file: This solu­tion requires the addi­tion of code within the analytics file.
Abil­ity to add code to your site: In addi­tion to analytics changes, you will also need to modify the video player code.
A current analytics code version: The solution requires H code version H24 or higher or appMeasurement.
A copy of the Media Mod­ule mea­sure­ment library: The Media Mod­ule JavaScript code is cur­rently avail­able through tag man­ager or from Client Care.  Make sure the library is from the same version as your analytics code.

Measurement Plan
I am not going to cover the mea­sure­ment plan here, but I strongly encour­age you to map out what aspects of video play­back you need to cap­ture and select the Analytics variables you will use before you start mod­i­fy­ing your code.  A mea­sure­ment plan will help with imple­men­ta­tion and pro­vide doc­u­men­ta­tion into the future.

Measurement Library
After design­ing a mea­sure­ment plan, modify the analytics code (appMeasurement or s_code) to include the Media Module. Be sure that you add the Media Module that corresponds to the code version currently in use. If you are updating your analytics code, the Media Module is included in the downloads available within the Code Manager section within Reports & Analytics.  (You can see an exam­ple of the Media Mod­ule in this appMeasurement.js file for the sam­ple player.)

Player Mapping
There are two steps to the JW Player player mapping: calling the video player correctly on your page, and adding the JW Player player mapping code to your analytics file.

Edit the page level code used to call the JW Player video player to include the trackMilestones function. This function acts as an indicator that the video player has loaded. Depending on the instantiation method used on your site, you may need to slightly modify this behavior.

Next, add the JW Player player mapping to your analytics code file within the plug-ins area. The code maps the JW Player events to the Analytics Media Module methods. The code can be grabbed from the sample player’s appMeasurement file.

The trackMilestones function wraps the player mapping. This would be line to change to modify the player ready indictor.  The player name is a required variable but can be modified to match your desired formatting and value.  The JW Player player mapping includes the basic hooks and methods for capturing video advertising playback. This code can be removed or modified as required by your measurement plan.   See more of the JW Player API options.

Variable Mapping
With the player mapping 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 analytics file. Follow your measurement plan for the proper frequency and variable usage. In the sample player I am setting quartiles.
A few things to note about this sam­ple code:

Enable Video Track­ing: I rec­om­mend wrap­ping the vari­able map­ping in a true/false vari­able. In this exam­ple I am using s.enableVideoTracking. This allows a devel­oper to eas­ily turn on and off the video track­ing and also con­tains the vari­able map­ping within one function.

Track Vars: Make sure to include all the vari­ables and events in the s.Media.trackVars and s.Media.trackEvents vari­ables or the vari­ables may not show up in your track­ing calls.

Auto Track: s.Media.autoTrack is set to false because we added player spe­cific event lis­ten­ers in the player map­ping code.

After completing implementation, load your files into a browser and use a packet sniffer to check the tracking calls. You should see a group of a.media context data variables. All the context variables can be mapped to Analytics variables by using the processing rules within SiteCatalyst.