Radiant Media Player

Google Analytics

Google Analytics documentation sections


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 help with identifying viewing issues.

Our Google analytics integration will help you track video-centric data coming from Radiant Media Player in both real-time or "next-day" reporting. We have done most of the heavy lifting for you, essentially you just need to enter your Google Analytics property ID as an input setting and the player will start sending logs to your Google Analytics back-end.

You can also refer to our analytics API for more advanced use-cases and custom integration.

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.

gaEvents: Array

Lets you customise which events should be sent to Google Analytics. Default: ['context', 'ready', 'playerstart', 'error', 'adimpression', 'adloadererror', 'aderror'].

Player code example

<script src="https://cdn.radiantmediatechs.com/rmp/4.7.0/js/rmp.min.js" 
<div id="rmpPlayer"></div>
var bitrates = {
  hls: 'https://dqwp3xzzbfhtw.cloudfront.net/vod/smil:bbb.smil/playlist.m3u8'
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,
  width: 640,
  height: 360,
  poster: 'https://www.radiantmediaplayer.com/images/poster-rmp-showcase.jpg',
  // Our Google Analytics settings
  gaTrackingId: 'UA-XXXXXXXX-Y',
  gaCategory: 'E-learning video',
  gaLabel: 'How to start with HTML5 video',
  gaEvents: ['context', 'ready', 'playerstart', 'error', 'adimpression', 'adloadererror', 'aderror']
var elementID = 'rmpPlayer';
var rmp = new RadiantMP(elementID);

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 both real-time and "next-day" reporting in your Google Analytics back-end (events can be tracked in Behavior > Events).

Note that Google Analytics imposes Limits and Quotas. As such the data collected by our Google Analytics implementation may only be partial - if you go over your account limit Google decides when to collect data or not. Our implementation takes this into account and allows to be customised to just send the events you are after. 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.

Player events tracking for Google Analytics

Below is the list of default 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. When using related, playlist or the setSrc API method this event will fire each time a new item has started within the player.
  • 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.
  • adloadererror: the player could not load the ad parser to start loading ads (either IMA or rmp-vast). Most of the time this means an ad-blocker is used. This event only fires once per player session.
  • aderror: the player has registered an aderror. The main types of aderror are:
    • Ad request not filled: there was no inventory on the ad server at time of ad request, thus the ad server has returned a VAST response corresponding to this situation. This should represent the majority of your aderror. Fill-rate may vary in the industry depending on settings like targeted countries, type of audience ...
    • Capping on ad server: ad servers tend to cap ad requests if they see repeated requests coming from the same client.
    • Ad server busy or network errors: depending on traffic or network conditions the ad server may timeout or return HTTP errors when it receives ad requests.
    • Ad play error: the player receives an ad it could not play.

Additionally you can also pass the following event through the gaEvents setting:

  • enterfullscreen: the player has entered fullscreen mode. This event may fire multiple times 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.
  • seeking: the player has received a seek order. 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.

If the 'context' event is also provided through the gaEvents setting ('context' is included by default), the player will also send data about the context in which it is rendered. The value of the context event can be one of the following (the related context event only fires once per player session):

  • html5-hls: the player is loaded in HTML5 mode with HLS.
  • html5-hlsHevc: the player is loaded in HTML5 mode with HLS-fmp4 HEVC.
  • 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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.