UK +44 28 9078 5820 IRL +353 16373962

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.