Tracking Embedded YouTube Videos with Google Tag Manager

Wish you could see better data about how users engage with embedded YouTube videos on your website? Sure, Google Analytics will show you how many people visited the page containing your video, but by default you won’t see performance for the video itself without heading over to YouTube Analytics. Thankfully, Google Tag Manager offers built-in triggers allowing you to track performance on a granular level, without having to write a line of code.

In this article, we’ll walk through setting up tracking for embedded YouTube videos using Google Tag Manager (GTM), as well as how to view the resulting data in Google Analytics. If you haven’t yet set up GTM on your site, walk through Google’s Quick Start Guide.

Setting Up a YouTube Trigger

To start, navigate to your desired GTM container and go to Triggers from the lefthand menu. Click “New” to begin creating the trigger.

Now, click within the “Tag Configuration” box to choose your tag type. Select “YouTube Video” from the list.

Next, you’ll see a list of options for what you’d like to track with the trigger. Check the boxes for what you’d like to include in Analytics.

  • Start tracks an event each time a user begins watching a video
  • Complete tracks an event each time a user reaches the end of the video
  • Pause, Seeking, and Buffering tracks an event when a user takes any of those actions
  • Progress allows you to mark events based on how far a user watches a video.
    • If you choose Percentages, enter numbers separated by commas for which percentage points you’d like to track. For instance, the given example will register an event at 10%, 25%, 50%, 75%, and 90%.
    • If you choose Time Thresholds, your numbers will reflect seconds watched.

For general use, you can likely ignore the JavaScript API checkbox. Finally, you can select which videos the trigger will fire on. If you want it to fire for every video across the entire site, choose “All Videos.”

To fire only for specific videos, choose “Some Videos.” Now, you can define parameters for when the trigger will fire. You can choose from a number of preset variables, including page-specific criteria or video-specific criteria like video title or duration watched.

In this example, we’ve chosen to only fire the trigger for videos on an About page URL. After entering the URL path, we’ll save the trigger.

Setting Up the Google Analytics Tag

Next, you’ll need to set up a tag to send events to your Google Analytics account. First, you’ll need to make sure you’ve activated the video-related variables.

Go to Variables from the lefthand menu and click “Configure.” In the list that appears, scroll to the Video category and check the boxes next to each contained element to enable for use in tags.

Now, navigate to the Tags section and create a new tag. Choose Google Analytics as the Tag Type. Then, select Event from the Track Type menu.

Now, you can set up the tag to show the event parameters you’d like to populate in Google Analytics. This may depend on your specific use case; you can select the “brick” icon at the right of any field to add in variables.

For instance, this example will automatically populate the video status and percentage watched in the Action field, and the video title and URL in the Label field. See Simo Ahava’s blog post for a more detailed solution that allows you to auto-populate the video action (play, pause, percentage watched, etc.) using a Javascript variable.

Next, click within the Triggering field to add a trigger. Select your previously created YouTube trigger here. Save your tag, and be sure to publish your changes live for them to take effect (or test in GTM preview mode).

Viewing Data in Google Analytics

Once you’ve set up the trigger and allowed some time for data to accrue, you should then see video-related events appearing in Google Analytics. In your Analytics account, navigate to Behavior > Events > Top Events from the lefthand menu.

Now, you should see a “YouTube” event category (or whatever you named the Category field in GTM) appearing if events have been tracked. Click this to see more detail.

The specifics will depend on how you defined the fields. In this case, we’re viewing actions such as video starts and percentage watched, along with the video title and URL in the label field.

Start Tracking!

If you haven’t yet set up the YouTube trigger to get better data on your embedded videos, dive into GTM and get started! It’s relatively simple to set up and will reward you with better data showing which videos your website visitors engage with the most and where they’re dropping off in video views.

Do you have any further tips for customizing the YouTube video trigger? Share in the comments below!

To learn more, see our BIG List of Google Tag Manager Guides & Resources.

Comments (10)

  1. This is very helpful, thanks Tim.

    Quick question:
    can you track any embedded video on your pages or do the videos have to be your own – meaning they are your videos that you uploaded to your YouTube account and then embedded them on your site. Or can you see engagement metrics for videos that are not your videos but you embedded them on your pages?

  2. Hi there Tim, I’m able to see the trigger fire while in GTM Preview mode, but after publishing, the events are not showing up in Google Analytics.

  3. Hi Victor-
    It’s tough to fully troubleshoot without seeing your exact setup, but here are a few things I might check
    -Make sure you’re using the right Google Analytics ID
    -Are you checking Real-Time Analytics? The event should show up right away there, but will take some time to show up in the main interface
    -Is your IP blocked from your GA account?

  4. Hi Tim, appreciate the reply!
    – Checked GA, everything was properly setup
    – Checked Real-Time Analytics inside GA, none of the click events were showing up.
    – IP is not blocked on GA account.

    One of the caveats is that I’m using Instapage ( and I’m not sure how they’re adding the YouTube embed. But since the trigger was firing while in Google Tag Manager preview mode, I figured it should be working? 🤷‍♂️

  5. Hi Victor,

    That’s frustrating! Our team has had some trouble getting pixels to fire in Instapage for a client that uses it. Might be worth checking with their support too to see if anything on their end is blocking the script.

  6. Hi Tim,

    Thank you for the instructions! I went ahead and followed the steps, however once I publish the tags, I don’t see the any of the events when I check my ‘Top Events’ – I’m not sure what could be the problem

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.