Advanced Settings for the Media Analytics Feature
In this guide, you will learn how to customize how your video and audio media content is tracked (e.g. how to customize video titles and URLs), and how to specify which videos and audio should be tracked or ignored.
Set video and audio titles
When analyzing your media reports in MVMCloud Analytics, media titles are often more useful than media HTTP URLs (which can only contain random numbers and letters). The YouTube and Vimeo player allows us to retrieve the video title automatically, so that your video reports directly show the original video titles. If you use HTML5 videos or audios or want to customize video titles in your analytics reports, read on. The Media Analysis feature will detect the media title by searching for the following information:
- Firstly, the
data-mvm-title
HTML attribute; - YouTube/Vimeo player media title;
- The
title
HTML Attribute; - Finally, the HTML
alt
attribute.
Titles are detected at this priority, which means you can set a data-mvm-title attribute to replace the YouTube or Vimeo video title. The data-mvm-title attribute always has the highest priority and overrides any title received from a media player.
<video data-mvm-title="My priority video title"
title="Original video title"></video>
In the example above, your video analytics reports in MVMCloud Analytics will show "My priority video title" as the media title. If the video title cannot be detected (depending on your media player) and none of these HTML attributes are set, the title will be shown as "Unknown".
JW Player
If you want to track a custom title that is different from your video title, you can provide a custom title that will be used for tracking purposes only specifying a playlist item in the configuration method like this:
playerInstance.setup({
playlist: [{
file: "https://example.org/actualUrl.mp4",
title: "My Video",
mvmTitle: "My custom video title"
}]
});
Flowplayer
If you want to track a custom title that is different from your video title, you can provide a custom title that will be used for tracking purposes only specifying a playlist item in the configuration method like this:
flowplayer("#player", {
clip: {
sources: [
{type: "application/x-mpegurl", src: "https://example.org/actualUrl.m3u8"},
{type: "video/mp4", src: "https://example.org/actualUrl.mp4" }
],
title: "Video title",
mvmTitle: "My custom video title"
}
});
If you embed Flowplayer using the <video>
element, you can set the data-mvm-title attribute on the video element directly.
Replacing the URL of the video/audio resource being crawled
By default, a media's HTTP URL is obtained from the player API or read from the DOM. There may be use cases where you want to track a URL custom resource instead of the actual resource. For example, when your media URLs contain unique IDs and you prefer to have more readable when analyzing MVMCloud Analytics reports. To do this, you can define a custom resource via the data-mvm-resource HTML attribute. For example:
<video src="https://example.org/Urlreal.mp4"
data-mvm-resource="https://example.org/Urlrastreada.mp4"></video>
JW Player
If your resource URL is, for example, user-dependent and you always want to track the same resource, you can provide a custom resource by specifying a playlist item in the configuration method as follows:
playerInstance.setup({
playlist: [{
file: "https://example.org/actualUrl.mp4",
title: "My Video",
mvmResource: "https://example.org/trackedUrl.mp4"
}]
});
Flowplayer
You can provide a custom resource URL when using flowplayer by specifying the mvmResource property:
flowplayer("#player", {
clip: {
sources: [
{type: "application/x-mpegurl", src: "https://example.org/Urlreal.m3u8"},
{type: "video/mp4", src: "https://example.org/actualUrl.mp4" }
],
title: "Javascript setup",
mvmResource: "https://example.org/Urlrastreada"
}
});
If you embed the flowplayer using the <video>
element, you can set the data-mvm-resource attribute on the <video>
element directly.
Restricting what media data is tracked
Exclude specific media from tracking
By default, all detected videos and audios will be scanned. To avoid tracking a specific media while still tracking other media,
you can set a data-mvm-ignore attribute on a <video>
or <audio>
element to ignore it. For example:
<video data-mvm-ignore>...</video>
<audio data-mvm-ignore>...</audio>
<iframe data-mvm-ignore src="..."></iframe>
Skipping all media using a given media player
To avoid tracking any media from a specific media player, you can disable scanning for one or more players using the removePlayer method:
_paq.push(['MvmMediaAnalytics::removePlayer', 'playerName']);
playerName
must be a html5
, vimeo
or youtube
player. For example, if you don't want to track any Vimeo videos, you can remove this player as follows:
_paq.push(['MvmMediaAnalytics::disableMediaAnalytics']);
To enable scanning again later, call the enableMediaAnalytics
method followed by a scanForMedia
:
_paq.push(['MvmMediaAnalytics::enableMediaAnalytics']);
_paq.push(['MvmMediaAnalytics::scanForMedia']);
Is it possible to disable tracking of media events such as play, pause, resume and complete?
Yes, media event tracking can be disabled by calling the following method:
_paq.push(['MvmMediaAnalytics.disableTrackEvents']);
This will stop tracking any action events, while still tracking usage of the videos and audio itself. This means you will still receive all media reports listed in the "Media" menu category, but you will not see no media events in the Visit Log or in the "Action => Events" report.
It is recommended to call this method as early as possible, for example, right after _paq.push(['setSiteId', 'X']);
Is it possible to disable tracking of media data, such as how often or how long a piece of media has been played, while still tracking events such as 'play' and 'pause'?
Yes, media tracking can be disabled by calling the following method:
_paq.push(['MvmMediaAnalytics.disableTrackProgress']);
This will stop tracking the media's progress. In the "Media" menu category, most reports do not show any data. The Visit Log and the "Actions => Events" report will still show data unless you disable event tracking as well.
It is recommended to call this method as early as possible, for example, right after _paq.push(['setSiteId', 'X']);