Radiant Media Player

Analytics Documentation



Last updated on September 1, 2017.

Introduction

Video related analytics are an important part of a successful online video strategy. It can tell you which content works best for your audience and provide guidance on how to increase viewer engagement and revenue.

Radiant Media Player provide several options for getting media-related analytics.


Google Analytics

Player settings

gaTrackingId: String

Google Analytics property ID. Typically looks like UA-XXXXXXXX-Y. Default: ''.

gaCategory: String

Set the Google analytics tracking category. Typically the object that was interacted with (e.g. 'Video'). Default: 'RMP'.

gaLabel: String

Set the Google analytics label for each events. Use it to uniquely identify your video (e.g. 'Fall Campaign'). Default: 'RMP label'

gaNamedTracker: String

In some cases you might want to send data to multiple properties from a single page. This is useful for sites that have multiple owners overseeing sections of a site; each owner could view their own property. In such cases we need to configure Google Analytics to work with multiple trackers. When set this setting allows to do just that with a custom tracker based on gaNamedTracker. The player will automatically send data with this named tracker. Default: '' which means no specific named tracker is used.

Specific Google Analytics considerations

Our implementation is based on the analytics.js event tracking documentation. Refer to this documentation for more information. Events can be tracked in real-time or for "next-day" reporting in your Google Analytics back-end (events can be tracked in Behavior > Events).

Google Analytics imposes Limits and Quotas. As such the data collected by our Google Analytics implementation may only be partial - but still relevant bacause based on a good sample of your audience (if you go over your account limit Google decides when to collect data or not). Our implementation takes this into account and is made to send only the required information to Google Analytics. If you have a high volume of monthly video views you may consider upgrading to a Google Analytics 360/premium account for better analytics data accuracy.

Each tracked media content should be sorted by gaLabel in order to see relevant data for a given asset. The ready and startuptime events provide associated values in milliseconds. You need to look at average values for those 2 events.

Generic player events tracking for Google Analytics

Below is the list of tracked events when a valid gaTrackingId setting is provided.

  • ready: the player has reached the ready state. This event only fires once per player session.
  • playerstart: this event fires when the first frame of content or pre-roll ad, if any, is presented to the viewer. This event only fires once per player session.
  • ended: the player has reached the end of the content. This event may fire multiple times per player session. When loop setting is used this event may not fire.
  • enterfullscreen: the player has entered fullscreen mode. This event may fire multiple times per player session.
  • seeking: the player has received a seek order. This event may fire multiple times per player session.
  • srcchanged: fires when a source change happens in the player (either through setSrc API method, playlist or related).
  • error: fires when a fatal error is encountered by the player (often due to a network issue where the player is unable to fetch content).
  • adimpression: fires when the impression URL has been pinged. This event may fire multiple times per player session.
  • adclick: the player has registered a click for an ad. This event may fire multiple times per player session.

The player will also send data about the context in which it is rendered. The related event will only fire once per player session.

  • html5-hls: the player is loaded in HTML5 mode with HLS.
  • html5-dash: the player is loaded in HTML5 mode with DASH.
  • html5-mp4: the player is loaded in HTML5 mode with MP4 progressive download (H.264/AAC).
  • html5-mp4Hevc: the player is loaded in HTML5 mode with MP4 progressive download (H.265/AAC).
  • html5-webm: the player is loaded in HTML5 mode with WebM progressive download.
  • html5-m4a: the player is loaded in HTML5 mode with M4A (audio-only) progressive download.
  • html5-mp3: the player is loaded in HTML5 mode with MP3 (audio-only) progressive download.
  • html5-outstream: the player is loaded in HTML5 mode with outstream ads (no content).
  • flash-hls: the player is loaded in Flash mode with HLS.
  • nosupport: the player displays a no-support message to the viewer because it has no valid playback option.

Advanced player events tracking for Google Analytics: content mark analytics

Tracking content mark data for Google Analytics must be enabled with player setting gaAdvanced. This option is only available for on-demand media content. This will cause the player to send more data to your Google Analytics account. Content mark analytics try to reproduce the heatmap analytics pattern describe below but within the constraints of what can be done within Google Analytics. Still it should really help you to tell which type of content works better for your audience and which parts of this content are consumed.

content mark analytics are based on estimates and statistics pattern. They can provide an indication as to how your media content is consumed but may not be 100% accurate.

gaAdvanced: Boolean

Enables tracking of content mark data for Google Analytics. Default: false.

The following events are sent to Google Analytics when a specific % mark of the content has been reached. A given content mark event can be sent multiple times within a player session assuming the same mark of the content is reached multiple times.

  • contentmark: 10%
  • contentmark: 20%
  • contentmark: 30%
  • contentmark: 40%
  • contentmark: 50%
  • contentmark: 60%
  • contentmark: 70%
  • contentmark: 80%
  • contentmark: 90%

Player API analytics methods

Analytics data can be delivered by the player with JavaScript. See our player API documentation for a better understanding of how to use the player API.

getTimeViewed
rmp.getTimeViewed()

This methods returns a Number expressed in milliseconds that represents the cumulative time viewed for the current player instance. Returns -1 if not available. This number can exceed content duration if the same part of content is viewed multiple times for a given player session.

getPercentViewed
rmp.getPercentViewed()

This methods returns a Number expressed in % that represents the cumulative percent viewed for the current player instance (example 20 for 20%). This is calculated against content duration. It will only return valid for on-demand content as for live/DVR content the duration is unknown. Returns -1 if not available. This number can exceed 100% if the same part of content is viewed multiple times for a given player session.

getTimeReady
rmp.getTimeReady()

This methods returns a Number expressed in milliseconds that represents the time for the player to be ready (i.e. fully appended to DOM and ready to receive API calls). Returns -1 if not available.

getStartUpTime
rmp.getStartUpTime()

This methods returns a Number expressed in milliseconds that represents the time needed for the player to display the first frame of the video/audio after initial user interaction (or autoplay). Returns -1 if not available. This method will return an actionable value when the startuptimeavailable player event fires.


Heatmap player API

A heatmap represents which parts of your content are actually being consumed by your audience. For example in the case of soccer when a goal happens viewers will tend to replay a reduced section of the content multiple times indicating a clear area of interest. Better than words an image:

heatmap representation

The idea here is to provide API player methods in order to reconstruct a heatmap for a given asset. This is only available for on-demand video. Live/DVR content have fluctuant duration and thus a heatmap cannot be drawn.

The heatmap analytics API is a client-side API. In order to get to a complete solution you will need to send the information provided by the player to a remote logging server where heatmap analytics data can be stored and processed. This last part is for you to set up.

getRawHeatMap
rmp.getRawHeatMap()

This methods returns an Array. The array size is dictated by the heatMapAccuracy setting (see below). Each item of the array consists of an incremental number of player ticks. A player tick is registered each time the timeupdate event fires.
Typically after a certain amount of time playing a video the getRawHeatMap method may return something like:
[18, 19, 18, 19, 81, 84, 45, 36, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

This would be the output for the heatMapAccuracy default value of 20. This means that ticks are logged within segments that represent 5% (1/20) of the content. The first number in the array - 18 - means that when the getRawHeatMap method was called 18 ticks have been registered for the first 5% of the content. At index 4 of the array we can see an increase in ticks, 81 then at index 5, 84 ticks. This means that this area of the video has been watched more intensively by the viewer while the second half of the video was completely ignored.

This can effectively tell you which parts of a content work for your audience.
In order to draw a clear picture you will need to query the getRawHeatMap method at regular intervals or when the player session ends (e.g. a browser tab/window is closed) and to send those data to a logging server for post-processing.

heatMapAccuracy
heatMapAccuracy: 20

This is a player setting. The value must be a Number. The default is 20 which means that the content will be cut into 20 segments. Each segment represent 5% of the content duration. Ticks are logged for each of those 5% segments.

You can increase accuracy up to 100. With a 100 value the player ticks will be logged within segments that represent 1% of the content duration.

You are most likely going to have to play around with the above methods/player setting in order to grab the full scope of the heatmap concept and how powerful it can be in order to achieve a successful online video strategy.


3rd-party analytics service integration

By default, Radiant Media Player integrates with Google Analytics. You could want to build your own custom Google Analytics integration or support other analytics services like comScore, Adobe Site Catalyst or Nielsen. This can be achieved through our player API. Assuming your analytics service can send and receive information through JavaScript, all player API events and methods can be tracked.

In the example below we show how to retrieve commonly needed analytics information through the player API.

<script src="https://cdn.radiantmediatechs.com/rmp/4.4.19/js/rmp.min.js" 
  integrity="sha384-MHxuw6s8n+Uh8xT1LYC0zcidvLkX9DN0otZPYoamhjIU8svCQARWXpRYEXV6o6LI"
  crossorigin="anonymous"></script>
<div id="rmpPlayer"></div>
<script>
var bitrates = {
  hls: 'https://dqwp3xzzbfhtw.cloudfront.net/vod/smil:bbb.smil/playlist.m3u8'
};
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,
  delayToFade: 3000,
  width: 640,
  height: 360,
  ads: true,
  adTagUrl: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml', 
  poster: 'https://www.radiantmediaplayer.com/images/poster-rmp-showcase.jpg'
};
// Reference to the wrapper div (unique id)
var elementID = 'rmpPlayer';
// Object creation
var rmp = new RadiantMP(elementID);
// Reference to the player container which will receive API events
var rmpContainer = document.getElementById(elementID);
// We attached our listeners to be notified of player events
rmpContainer.addEventListener('waiting', function() {
  // player is buffering
  // TODO: send data to our custom analytics service
}); 
rmpContainer.addEventListener('play', function() {
  // player has been played
  // TODO: send data to our custom analytics service
});
rmpContainer.addEventListener('pause', function() {
  // player has been paused
  // TODO: send data to our custom analytics service
});
rmpContainer.addEventListener('ended', function() {
  // player has ended content
  // TODO: send data to our custom analytics service
});
rmpContainer.addEventListener('timeupdate', function() {
  // player has moved its playhead
  var currentTime = rmp.getCurrentTime(); // current playback position in milliseconds
  if (currentTime > XX) {
    var fullscreen = rmp.getFullscreen(); // current fullscreen state of the player
    var volume = rmp.getVolume(); // current player volume 
    var source = rmp.getSrc(); // current player source media file
    // TODO: send data to our custom analytics service
  }
});
rmpContainer.addEventListener('adimpression', function() {
  // player has pinged the VAST impression URL
  // TODO: send data to our custom analytics service
});
// Player initialisation only after API events are registered
rmp.init(settings);
</script>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.