It used to be a lot more difficult tracking embedded Youtube video plays using Google Tag Manager. You either had to write your own custom script to listen for the actions, or use one kindly written and shared by some of the wonderful people within the analytics community.
Thanks to Google and the new built-in video tracking triggers and variables, it’s thankfully much, much easier in 2018. Although it is significantly easier now, there are still quite a number of variables and events to be tracked and ways they can be combined together – so the guide below explains how we’ve gone about it, allowing us to essentially track all of the important video actions using just the one tag.
1. Enable all of the new built-in video variables
These aren’t enabled by default, so you’ll have to go in and tick all of the boxes in order to see the variables and their associated values whenever a video interaction takes place.
2. Set up your Youtube Trigger
We use the setup below – we’re most interested in knowing each time 25% of a video is viewed, although you can change this to be other percentages or time values if you prefer. Also tick the box to add API support as this simply means GTM will append the relevant parameters to enable video tracking if they’re not there already.
3. Create a Lookup Table for the Video Actions you want to track
We saw from Step 1 that we have a number of video variables to play with – and we also know that when we’re setting up a Google Analytics event tag, we’ve only got 3 slots to fill in, the Category, Action and Label. This Lookup Table will allow us to populate the event tag appropriately for each action, all within the one tag. This is the step where the magic happens…
From the table below, you’ll see that we’re using the built-in {{Video Status}} variable, which gives us basic actions (start, pause, progress, etc) – we’re then renaming those actions in a more user-friendly manner and adding the {{Video Percent}} viewed to the output when a video progress action takes place.
4. Create the Google Analytics Event tracking tag to send the appropriate data to Google Analytics
We’ve used {{Video Actions}} as the Event Action – which is the resultant output from the Lookup Table above and for the label, we’ve combined both the {{Video Title}} and the {{Video URL}} so you can easily see at a glance which video has been viewed, and its URL, within the reports.
Once you’ve created the tag, all you have to do is associate it with the trigger we created in Step 2.
Note: in some rare instances – for example, when a Youtube video loads dynamically in a pop-up/lightbox style display, you’ll also need to ensure this Custom HTML tag is fired on the initial page load before the user action takes place which brings the Youtube video into display.
It doesn’t happen very often, but if you find your Youtube videos aren’t being tracked and your website loads content dynamically, try firing this line of code on the page first.
If you have any problems following the steps above, let us know – either in the comments below or via email – we’re always happy to help.
Posted by
Michael Wilson
Michael is the Digital Analytics Director at GlowMetrics, implementing complex tracking for our largest clients via Google Tag Manager while leading our wider analytics work across Google Analytics, Data Studio and Optimize
Read more from Michael WilsonBrowse by Category
- Social Media
- SEM
- SEO
- Google Ads
Digital Marketing
- Google Analytics
- Google Tag Manager
- Google Opimize
Digital Analytics
Optimise your website and marketing campaign performance with Ireland’s leading digital analytics agency
Sign up to our newsletterEnjoyed reading this article? Find more like it below…
Posted by
Michael Wilson
Dec 2nd 2021
Digital Analytics Insights
2 min read
What is /trafficbot.life and why is it appearing in Google Analytics?
There was a significant surge in bot traffic in Google Analytics from 31st January to 2nd February 2021. One of the most common issues we saw came from /trafficbot.life and...
Posted by
Georgia Sloan
Oct 31st 2023
Company Updates
2 min read
Get to know Georgia!
Hi, I’m Georgia. I have recently joined the Glowmetrics team as a Digital Analytics Assistant. My journey into this role began with an undergraduate degree in microbiology, which led me...
Posted by
Conor Ross
Nov 22nd 2023
Digital Analytics Insights
4 min read
Adding Sparklines to Scorecards in Looker Studio
With the sunsetting of Universal Analytics and much of the industry’s focus on Google Analytics 4, you’d be forgiven if data visualisation techniques and embellishments in Looker Studio hasn’t been...
Leave a Reply