YouTube - Troubleshooting common problems

If you have activated the Youtube App in Triggerbee but get no events or goals in the Triggerbee session - check these common problems:

 

The video has an old/deprecated embed-code

URL should be something like this: youtube.com/embed/{id}. 

NOT like this: youtube.com/v/{id} (known as "AS3"-player)


Flash is used (<object>)

The video must be an iframe. <object> embeds are deprecated since January 27, 2015 


onYouTubeIframeAPIReady is already declared

Documentation for Youtube javascript API.

In the javascript console you will se something like this: Warning from mtr_youtube: onYouTubeIframeAPIReady is already declared on this site

In that case a developer must implement our tracking events manually (inside the function onYouTubeIframeAPIReady).

Send Youtube-events by using the 'onStateChange'-method (Youtube javascript API) and this line of code: 
mtr_youtube.HandleEvent(yourEvent)

 

Video is loaded asynchronously (ajax)

In this case you must implement the event-tracking manually. See previous step ("onYouTubeIframeAPIReady").

 

Listening to Events

onWatchedEntireVideo

The event is fired when a video

if(document.addEventListener){
document.addEventListener("onWatchedEntireVideo", function(e) {
// add your own code
// var videoTitle = e.videoTitle;
// var videoId = e.videoId;
});
}
else if(document.attachEvent){
document.attachEvent("onWatchedEntireVideo", function(e) {
// add your own code
// var videoTitle = e.videoTitle;
// var videoId = e.videoId;
});
}