Open penguinstampede opened 10 years ago
Hey @penguinstampede thanks for the PR.
I'm not very familiar with GTM but according to the documentation the dataLayer
can eventually be renamed.
Ideally I would detect the dataLayer whatever his name is. I searched a couple of minutes and didn't find any way to do this. I'll check againg tonight or t-row. If I don't, I'm inclined to accept your PR + add an option to pass the dataLayer. What do you think?
Cheers
@mickey & @penguinstampede
Great plugin & a life saver!
But, needs some small refinements...
Updated example... http://83.223.104.160/~searchph/_testing_script/__itv/gtm-code-examples/videojs-ga-f20f7478752c221ebde9a98e6602f1394d26c3e7/dist/videojs.ga.js
dataLayer.push({ 'event': 'video', 'eventCategory': 'video', // Added 'eventAction': action, 'eventLabel': eventLabel, 'eventValue': value, 'eventNonInteraction': nonInteraction, // Changed 'videoId': '' // Added - CustomDimension - Used for server-side data append });
Thanks
Phil. GTM specialist Useful ReadMe: http://bit.ly/gtmdevguide2
Any updates on this?
This js https://github.com/BrightcoveOS/videojs-ga-videocloud handles GTM. You just need to adjust labels to merge datas in analytics.
I needed the script to work with GTM, so I added a bit of code to check for the dataLayer variable. See https://developers.google.com/tag-manager/devguide