Learn why and how you can set up media analytics in your analytics.
Are your visitors watching your videos? Which types of visitors are watching your videos? Where are they watching it from? How long are they engaging with the videos? How well are your videos converting to sales?
The Media analytics feature lets you find the answer and help you make better decisions to reach your goals from your content.
Tracking Youtube videos
Media Analytics use the Youtube iFrame API. To track your Youtube videos, you need to enable the API by adding the URL parameter ?enablejsapi=1 to all your Youtube video’s URLs. For example:
<iframe src="https://www.youtube.com/embed/yA2NUur0770?enablejsapi=1"></iframe>
To be able to receive events from the Youtube player Media Analytics loads a file. If you already load this manually or if you don’t want this file to be loaded, you can disable the tracking by the following JS
method:
extellio_actions.push([MediaAnalytics::removePlayer’, ’youtube’]);
If you’re already using the onYouTubeIframeAPIReady callback method, you need to let the tracker know when the api is available by calling the MediaAnalytics::scanForMedia method:
window.onYouTubeIframeAPIReady = function () {
// [...] your code
extellio_actions.push(['MediaAnalytics::scanForMedia’]); };
Tracking HTML 5
The Media analytics should track automatically; however, you might not be tracking the accurate title for your videos by default. We recommend setting a data-Matomo-title attribute on your <video> elements:
<video data-matomo-title="My Video Title">...</video>
or for HTML 5 audio:
<audio data-matomo-title="My Video Title">...</audio>
Tracking JW Player videos
The Media analytics should work automatically; however, you might not be tracking the accurate title for your videos by default. We recommend using the setup method for your video:
jwplayer("myDiv").setup({
"file": "...",
"title": "My Video Title" });
Tracking Flowplayer videos
The Media analytics should work automatically; however, you might not be tracking the accurate title for your videos by default. If you use the JavaScript embed method, you should specify a title:
flowplayer("#player", {
clip: {
sources: [
{type: "video/mp4", src: "https://example.org/actualUrl.mp4"}
],
title: "My Video Title”
}
});
If you embed Flowplayer using the video element, you can set a title using the data-Matomo-title.
Track Vimeo videos or SoundCloud audio
Tracking of Vimeo videos or SoundCloud audio works automatically if it’s embedded as an <iframe>.