Help with Video Tracking using Google Tag Manger

My goal is to track embedded, dynamically loaded YouTube videos using Google Tag Manger, and track interactions as events in Google Analytics.

Here’s what I’ve tried thus far:

  • LunaMetric’s “YouTube Video Tracking for GTM” container imported into GTM, and updated with the appropriate GA Tracking ID

  • Simo Ahava’s modified custom HTML tag for LunaMetric’s solution referenced above

  • native support for YouTube video tracking in GTM, using Simo Ahava’s guide (“The YouTube Video Trigger in Google Tag Manager”)

None of these solutions resulted in tags being fired, and no events related to video interactions were recorded in GA (tested independently, using Preview Mode in GTM). All other tracking tags related to link clicks, form submissions, etc. are functioning properly.

Per Embedly’s analytics support documentation, platform.js was installed on page, and both methods provided were tested.

After going into the Chrome Developer Console, I noticed the following error:

I found a thread on StackOverflow discussing this error as it pertains to YouTube videos, and a common solution seemed to be changing the URL for the target origin from https to http. I did exactly that (using Designer > Video Settings > URL), but I’m still getting the same error.

I’m afraid that I’ve fallen down a rabbit hole, and don’t know how to get out. Support documentation from Embedly is sparse, and their customer support team has been non-responsive thus far.

Any helpful tips or insights are greatly appreciated!

tl/dr: How do you track embedded, dynamically loaded videos in Webflow using Google Tag Manger?

Hi, I’m having the same issue but not using Embedly, just Vimeo’s native embed. Did you figure out what the issue is? I wonder if it’s a Webflow conflict?

Hi @scottfasser, we ended up using an HTML Embed element, and then pasting in the embed code directly from YouTube into the HTML Embed Code Editor. This enabled tracking of YouTube videos using GTM.

If I remember correctly, the tracking issue was due to nested i-frames, and using the HTML Embed element only wrapped the video in a single i-frame, which allowed the tag to fire.

I haven’t tested this with Vimeo videos, but it’s worth a shot.

Thank you! I think that fixed it - looks like GTM is picking up the tags now in preview. Whew!

Scott Fasser
VP of Marketing - Sigma IQ

scott@sigmaiq.com
206-713-4185
@scottfasser
www.sigmaiq.com

Machine Learning Solutions to Empower Finance & Accounting Teams.

1 Like

Hi Mike, can a HTML Embed element containing a YouTube video be connected to CMS fields? I am building dynamic YouTube pages with CMS, and want to track them with Analytics. Thanks, Andrey

Hi all,

Here was my fix -

The we had a popup or thumbnail play button over our video which then has a script when you click it to auto play the video behind. The script places the autoplay=1 into the video link. Unfortunately, the Google Tag Manager Video listener loads once when the page loads, so if you change the URL of your video it won’t pick it up.