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
Mar 13th 2015
Digital Analytics Insights
2 min read
Cohort Analysis (Beta) – Another new Google Analytics report!
Following on from the Active Users (Beta) Report we discovered recently, we've noticed another new addition in Google Analytics, the Cohort Analysis (Beta) Report. If you don’t have access to it yet,...
Posted by
Hannah Magorrian
Nov 8th 2022
Google Analytics
3 min read
Top Tips to Pass the Google Analytics Individual Qualification Exam
Google Analytics is a powerful tool and knowing how to use it can be very useful! The Google Analytics Individual Qualification, or GAIQ, demonstrates expertise in Google Analytics. To earn...
Posted by
Conor Ross
Jan 29th 2021
Digital Analytics Insights
7 min read
How To Uplift Data Based On Cookie Opt-In Rates in Data Studio
The topic of cookies and opt-in rates is becoming increasingly important in the world of digital analytics as we navigate 2021 and beyond, with Google Analytics tracking often not considered...
Leave a Reply