This article provides an attachment file named kaltura_extension.js.txt that contains a block of code that you can copy and paste into the JavaScript Code extension. For additional information about a JavaScript Code Extension, go to JavaScript Code Extension.

In this article:

Table of Contents Placeholder

Customize

Once pasted into the JavaScript code extension, you can customize the following two configuration fields at the top of the code:

  • video_events
    A list of events that you would like to track with the code. By default, this field is set up to track play, pause, complete, and milestones. You can optionally add events to the list, such as mute to track when a user mutes the volume. See the Output Variables section for a list of available events. For a list of all events, go to Kaltura Player Properties.
  • milestone_percentages
    A list of percentages that you would like to track as milestones. By default, this field is set to trigger an event when the video has reached 25, 50, 75, and 90 percent complete but can be customized to your specific milestones. You can optionally deactivate milestone tracking by removing the "playerUpdatePlayhead" event from the video_events list.

Best Practice

This code needs to run before the player loads. For this reason, the JavaScript Code extension where you paste the code should be scoped to PreLoader. Once the player loads, it calls a function called "jsCallbackReady" that must be defined before the player calls it or the events will not get tracked.

Output Variables

This output of this code is a set of data sources that you can add in the user interface and then use the data sources to send data to your tag vendors.

The output variables are as follows:

  • event_type = "video"
    • Always equals "video".
  • event_name = "play", "pause", "resume", "complete", "milestone"
    • These are the default names that are output. If you customized the video_events variable, they will display as customized, such as "newVolume" for the "volumeChanged" event.
  • video_position = "11"
    • The position, in seconds, of the video when one of the events took place, such as "pause" or "milestone".
  • video_duration = "119"
    • The length of the video.
  • video_milestone = "M:1:25"
    • Where "1" is the milestone number and "25" is the milestone percentage.
    • Allows you to see where your users drop out of the video.

For easy uploading to Tealium data sources, a csv file named video_data_values.csv is attached that contains each of the variables and descriptions.

FAQ

This code calls utag.link, which contains lines that are commented out that will support the Media Module for SiteCatalyst. Calling utag.link provides you with another extension to determine when to call the Media Module functions to make this extension more "plug and play" and need less customization.

Attachments
Version history
Revision #:
6 of 6
Last update:
‎09-18-2020 06:04 PM
Updated by: