Open ponchorage opened 8 years ago
Me neither... But I'm using videojs 5 and this plugin seems to work with v4 only. So I guess that's the reason why I don't see any log
I don't see this working in v5 either. Investigating.
The plugin works with 5, the debug is working, but not outputting what is expected. I've modified my sendbeacon() function to work as expected. Also, note my plugin initialization.
videojs('thing').ga({
'eventsToTrack': ['play', 'pause'],
'debug': true
});
sendbeacon = function(action, nonInteraction, value) {
if (window.ga) {
if (options.debug) {
console.log(action, value);
}
ga('send', 'event', {
'eventCategory': eventCategory,
'eventAction': action,
'eventLabel': eventLabel,
'eventValue': value,
'nonInteraction': nonInteraction
});
} else if (window._gaq) {
if (options.debug) {
console.log(action, value);
}
_gaq.push(['_trackEvent', eventCategory, action, eventLabel, value, nonInteraction]);
} else if (options.debug) {
console.log("Google Analytics not detected");
}
};
What should I see in the console log when I have set debug to true in the options? I've tried but I'm not seeing anything at all for some reason.