We will learn out to setup Tracking Engagement for YouTube videos in 2 parts. This is the first post addressing this subject.
The first part will cover how to set up tracking Engagement for YouTube videos embedded on our website using GTM correctly. The second part is more focused on the Google Analytics side of things and just a little more information about time tracking in GTM. It’s a continuation of the first post but with additional details and tweaks to better facilitate how we see the data in GA.

Google Tag Manager offers a built-in way to actually track engagement on YouTube videos that are embedded on your site. In this lesson, we’re going to go through all the details so that you can see exactly how to set that up.

Tracking visitor’s engagement with Youtube videos you embed on your website is possible with Google Tag Manager’s pre-built variables.

For the purpose of this post, I’ve created a rudimentary page with an embedded YouTube video.

The question is how are people engaging with the video? What actions are they taking? Because from a default analytics standpoint nothing much gets recorded after someone lands on your page. Analytics doesn’t know much about what’s going on. So if you were to pause the video, click on it, etc., analytics wouldn’t know unless you set it up. And this is when Google Tag Manager comes in.

First Step: Setting Up Variables

Our first step will be to configure some pre-built variables.
First, we’ll have to enable video variables.
Enabling video variables tells Tag Manager to start monitoring video information as they occur.
Click these:

Setting Up The Trigger

Go to triggers and click on New.
Under User Engagement select YouTube Videos. By default, you’ll notice that start and complete are already checked.

For now, we’re unchecking “Pause, Seeking and Buffering”.
Although I suggest you keep it checked on to track any moment (time) clicked on the video.

Quick explanations.
Start being checked means GTM is capturing tracking the moment when the video starts playing. The same goes for the stop. With stop being checked GTM will listen any moment the video gets stopped. Same for complete when a video gets completed.

There are 2 options for Progress: Time Threshold and Percentages.

You can either use seconds or percentages to monitor how far they got through your video.
In this example, we will use 10, 20, and 30 seconds. The format requires a comma to separate the values. So write it this way : 10,20,30.

Tip(lightbulb): time Threshold here is different then what you might think. If you skip the video to these time stamp the trigger won’t work. The way it works here is the view has to watch through the timer. The viewer must complete your set timing.

Under Advanced, we’re going to check the agile script API.
Keep in mind that you might not need it and. In our case, the video is not on autoplay. Hover over the tooltip to read more details. Notice it says that using this feature will cause the video the reload.
You have the choice between some video or all videos, and we’ll use all videos.

Save your trigger and rename your trigger.

I always like to write about the process of naming convention. Naming convention should help you remember what you did. You don’t have to follow this example to a T, although I believe its most useful.
Since we’re tracking engagement for a Youtube Video, we’ll start with YT. Then we can add info from the trigger, like the fact that it starts, complete, and also the 10,20,30 seconds.

Set up the Tag

Now we’re getting ready to tell what we want GTM to do.
We’re going to do a Google Analytics tag.
For the Track Type, we’ll select Event on the list because we’re telling GTM and GA to monitor and record an activity that analytics by default doesn’t. Like playing a video, etc.).

For Category we’ll type Engagement because this is what we’re tracking, we’re tracking how people engage with our site.

Under Action, we’ll put what the element actually is, which is a Video.
As for the Label, we can add more details about the video. We’ll use the video title. To have that information use the pre-built variable called {{Video Title}}.

Now lets quickly talk about another important Event Tracking Parameter: Non-Interaction Hit.
Here we have it set as “False“. GTM usually has the non-interaction hit set up as false by default.
Non-Interaction Hit = False means: “treat it as an interaction hit”. Just remember that.
For Google Analytics Settings pick your GA variable.

Why are we choosing this option?
This is because, after the page loads, visitors are taking additional action (playing the video, etc..
This is unlike scrolling for example which fires automatically after a page load. And even if different progression of the scroll on our page are firing, this is not really an action they’re taking. It’s not like they’re engaging with the scroll itself whereas clicking play on the video button is the kind of action we’re looking for and that is more focused.

Now Save and rename it :

Sorry, but just a quick side note. Look at how nice naming conventions are.

So far weve been naming our variables, tags and triggers strategically to remember what we did. We see the name of our Tags (under tags) and we see their Triggers (under triggers), if you follow it nicely it really tells a summary of what you did.

We’re doing a GA event for YT videos when a YT Video passes though the 10,20,30 seconds mark from starts to finish

Anyways, let’s continue…

Go To Preview Mode:

Note: we played the video for a little more than 3o seconds.
Starting from 10 seconds we see that our tag fired.
All the YT video tags can be seen on the event panel to the left.
Now select “Variables (top tab in the preview mode) then select each of these variables to see their info:

We can see now that Tag Manageris is aware of all of this information here.
Now what can we do with it?
we’re passing it along to Analytics.

And we’ll conclude this first part for now. The second part will go over how to add minor changes in order to see what we’ve done in an understandable way in GA.