Unlimited Calculated Metrics - Free Download

YouTube Trigger Introduction

Hi I’m Chris and thanks for joining me for another video here at Digital Metrics Guru. Today we’re going to talk about tracking YouTube videos embedded on your site with Google Tag Manager.
Recently Google has released a new YouTube trigger inside of GTM. This has made it much easier for anybody to get up and tracking with Google Tag Manager on your YouTube videos.

Before we get into it I want to direct you over to DigitalMetrics.Guru/06download. Go over there and download a whitepaper that gets a little more in-depth of just what you can do once you do implement. How we can make sure that our videos are working as best as they can and how to report out on them. Again, DigitalMetrics.Guru/06download. Let’s get into it.

Selecting Built-In Variables

I’m over here in Google Tag Manager in my demo account. First thing we want to do is go into variables. We have to enable these new built-in variables.

Under built-in variables click on configure and then scroll a bit of a ways down into a new section called videos. We have a lot of different options here. For this demo in particular, we’re going to click video status, video title, and a video percent.

There’s other options as you see here how much of the video is visible, duration, the URL, etc. You can play around with those and Google specifically says in their documentation what all these mean. We’ll do some other videos in the future around changing things up in your YouTube tracking but for now those are the three that we need.

Creating the YouTube Tracking Trigger

We have them enabled and now we’ll go over and start creating first our trigger and then we’ll move back to the tag. Let’s create a new trigger. We’ll call it YouTube tracking. You can call it whatever you’d like. We’ll select it and new under user engagement we have a few new things here, but first and foremost what we’re looking for today is a youtube video. Go ahead and select that.

It automatically says that it’s going to capture starts and completes. if you want to capture pause, seeking, and buffering you can. We’re going to leave that blank for now and then also make sure to select progress. You can do it by time but most of us are going to do it by percentage thresholds. So you can type in any percentage thresholds you would like. for this I’m going to type in 10, 25, 50, 75, 90, and 100 percent.

Then this is a very nice thing. It says advanced though it’s not advanced at all really but it says add the JavaScript API to all YouTube videos. That is, it adds the js api to your site so you no longer have to add that to the video URLs on any embed. We’ll just go ahead and select that to fire the api for further YouTube tracking on all videos.

For anybody that wants to enable YouTube tracking on videos, you’re gonna probably wanted to place this on all videos. There are some instances where you may not want it on but let’s select it for now.

And that’s as easy as the trigger is to setup. It can’t get easier than that. Now let’s go back and now create our tag.

Unlimited Calculated Metrics - Free Download

Creating the Tag

So we have our base code here and we’ll call this new tag YouTube tracking. We’re going to go into the configuration of the tag. It will be an event tag within Google Analytics, so select Universal Analytics. Go in and select event. For the category I’m going to call this videos. Then for the action let’s start using some of those built-in variables that Google makes available to us in GTM.

The first one that we’re going to select is video status. This is going to tell us that the video is playing, if it stopped or paused, or the progress made within. Along with that we’ll hit a space and a dash and write the video percent as well. So if the video status is progress and it has hit one of those thresholds that we defined in the trigger, it will also show the video percent there.

You can get all that in and then within the label go ahead and select video title. Now that will show once you click in and say, “oh I want to see what’s been played 100%”, you click it and it
shows you all the video titles. That’s pulled straight from the title tag within YouTube so if your title of your video is “abc123” that’s what we’ll show there. We don’t need anything in the value this, though you can fool around with putting the duration in the value.

I label this as an interaction hit, but you could do non-interaction if you want a video view alone to still be labeled as a bounce, without other action.

Next go ahead and quickly do an override. Look up your Google Analytics base code for your tracking ID and make sure it’s there. We’re all set now, but I definitely encourage you to look into creating a custom metric for video played and video completed. For now we’re gonna avoid that. Now we add our already created trigger which we created called YouTube tracking. Select that and click save.

Test & Preview the Tag

To make sure everything’s working right let’s go ahead and preview the container. Once that’s loaded I’m going to go over to our dev site. I’m going to reload this make sure that the debugger is loading just fine. We have an embedded video here. Let me go ahead and play that and when I do right away YouTube’s tracking comes up.

I’ll click into that and this is exactly what we wanted here. So as we go down here just a little further we see a category of videos. Then the action of start, and it also shows that percent which is at 0% right at the start. Followed only by the label of the video title.

Creating the YouTube tracking right within Google Tag Manager has now been made immensely easier. I encourage everyone, if you already had a YouTube tracker to continue to use that. But if you would like to enhance things and simplify your workflow with the YouTube trigger, go ahead and do that as well.

Again go over to DigitalMetrics.Guru/06download. You download a white paper there were we’ll going to dive a little bit more in-depth on the YouTube tracking trigger. I’ll show you just how you can track the success of your videos using this new trigger.

Thanks again for watching and join us for the next video.

Unlimited Calculated Metrics - Free Download

Chris Kujawski

Founder and instructor at Digital Metrics Guru.

A passionate and driven digital marketer, specializing in Google Analytics, Tag Manager and Data Studio. A qualified expert in Google Analytics and Adwords, with more than 10 years experience delivering sound solutions to clients worldwide.

View all posts

Add comment

Popular Videos