Current version: (AGNO-JavaScript API)
The video player sets analytics data that can be interepreted via the receiveIVVIMessage
function in a script and used for proper analysis. See a script example below. Three things in the data list need explanation:
<script>
function receiveIVVIMessage(event) {
var data = event.data.data;
var videoId = event.data.videoId;
// You can use whitelist to track only events you are interested in
var eventsWhitelist = [
'uniquePlay',
'contentPlay',
// All ads events
/^ad/gi,
's1-playlist-json-loadtime',
'replay-button-clicked',
'recommendation-screen-shown',
'recommendation-tile-clicked',
// All social-sharing events
/^social\-sharing/gi,
// All progress events
/\-percent$/gi,
/\-seconds$/gi,
// All error tracking events
's1-playlist-json-loadtime',
'error',
/^error\-s1/gi,
];
if (videoId && eventsWhitelist.some(e => data.type.match(e))) {
var analytics_data = {
'event': 'video-event',
'eventCategory': data.eventCategory,
'eventAction': data.type,
'eventLabel': location.href,
'videoID': videoId,
'videoDuration': data.duration,
'videoTitle': data.title,
'videoPlayerName': data.brand,
'videoDateCreated': data.dateCreated,
'videoAccount': data.account,
'videoErrorDesciption': data.descriptionMessage,
'videoCategory': data.videoCategory,
'videoTags': data.videoTags,
'videoFormat': data.videoFormat,
'videoAdTag': data.descriptionAdTag
}
dataLayer.push(analytics_data);
}
};
// If you want to track messages from the player that is embed
// on the page with iframe you also need to add this line:
window.addEventListener("message", receiveIVVIMessage)
</script>
The player exposes events. This events can be picked up by every website with their Google Analytics, Google Tag Manager or Tealium implementation.