We are closing.

Dm banner

SublimeVideoDocumentation

Google Analytics add-on

Table of Contents

Introduction

Once configured, the Google Analytics add-on automatically tracks a list of events that will appear in your Google Analytics dashboard under the "Events" section. Tracked events includes:

  • when a video starts and ends,
  • a sharing button is clicked,
  • fullscreen is entered,
  • and many more!

In your Google Analytics dashboard, you can filter tracked events by categories, actions and labels. For a thorough description of Google Analytics Events, please refer to the ‘Event Components’ section of Google Analytics help page.

Set up your <video>

Please note that the attributes described below can be set via the Video Publishing Assistant.

The data-uid attribute

In order to make a video show up in your Google Analytics dashboard, you must give it a unique uid with the data-uid attribute. Here is an example:

<video class="sublime" data-uid="landscape1" poster="some-great-landscapes.jpg">
  <source src="http://yoursite.com/some-great-landscapes.mp4" />
  <source src="http://yoursite.com/some-great-landscapes.webm" />
</video>

Important note: It should be a unique string among all your videos. The string must be composed of alphanumeric, “-” (hyphen) and “_” (underscore) characters exclusively (case insensitive) and must be at least 1 character and less than 65 characters.
The actual regular expression used to validate the uid is: /^[a-z0-9_\-]{1,64}$/i.

Notes:

  • If you change the video uid, subsequent events for this video will be reported as if it’s a new video.
  • The data-uid setting respects the Player settings syntax.

The title attribute

To ensure a video is displayed with a nice title in your Google Analytics dashboard, simply use the title attribute. Here is an example:

<video class="sublime" title="My great landscapes" poster="some-great-landscapes.jpg">
  <source src="http://yoursite.com/some-great-landscapes.mp4" />
  <source src="http://yoursite.com/some-great-landscapes.webm" />
</video>

Notes:

  • If you change the video title, subsequent events for this video will be reported as if it’s a new video.
  • The title setting respects the Player settings syntax.

Tracked events

Categories

Category name Decription
SublimeVideo The event happened on your website.
SublimeVideo – External Sources The event happened on another website where your video has been embedded.

Actions

Action name Decription
Video load The video has been loaded (i.e. SublimeVideo has “prepared” it).
Video start The play button has been clicked or the sublime.play API method has been called.
Video end The video playback has reached the video duration or the sublime.stop API method has been called.
Fullmode enter The viewer has clicked the fullmode (fullwindow/fullscreen) button.
Quality select – HD The video has been played in HD quality.
Quality select – Base The video has been played in SD quality.
Sharing pane open The sharing button has been clicked and the sharing pane has opened.
Sharing click – Twitter The Twitter sharing button has been clicked.
Sharing click – Facebook The Facebook sharing button has been clicked.
Sharing click – Pinterest The Pinterest sharing button has been clicked.
Sharing click – Google+ The Google+ sharing button has been clicked.
Embed pane open The embed button has been clicked and the embed pane has opened.
Logo click The on-video logo has been clicked.

Label

The label is computed from the video’s title and uid: “<video title> (<video uid>)”

Please read the Set up your <video> section for instructions on how to set these attributes.

If you don’t specify a title for your video, it will reported as “untitled (<video uid>)”.

For instance, the label for the following video will be “The homepage video (home-video)”.

<video class='sublime' data-uid='home-video' title='The homepage video'>
  ...
</video>

Settings

The add-on has only two settings that can be set via your site’s Player editor page on MySublimeVideo or on a per-video basis through Player Settings.

google-analytics-enable

Allows you to enable or disable the Google Analytics events tracking.

Allowed values:

  • true – Enable Google Analytics events tracking.
  • false(Default) Disable Google Analytics events tracking.

Example:

<video class='sublime' data-google-analytics-enable='true'>
  ...
</video>

google-analytics-account

Warning: This setting is not supported with the Universal Analytics (analytics.js)

By default, SublimeVideo detects the Google Analytics account ID used in your page but you can use a different Google Analytics account ID by using this setting.

Allowed values:

Example:

<video class='sublime' data-google-analytics-account='UA-12344321-1'>
  ...
</video>