How to Track YouTube Videos with Google Tag Manager and Google Analytics 4?

Team TypeStack
Team TypeStack ...
Nov 30, 2022  . 6 min read
How to track YouTube videos with GTM and GA4 - TypeStack
How to track YouTube videos with GTM and GA4 - TypeStack
Table of Content

There are many tools available online that measure website performance inch by inch. You might get confused about which tool to go for.

Don’t get confused. Here is the best web analytical tool i.e. Google Analytics 4. Google Analytics 4 provides you with an amazing feature of tracking visitors, finding out which is the most popular traffic source, Google analytics Youtube video tracking and many more benefits.

You just have to first install GA4 to be able to track YouTube videos in Google analytics 4.

If you are a beginner and unaware of GA4, then here are the brief steps to install GA4 with GTM

  • Start with creating a new GA4 property
  • Create a data stream
  • Find and copy the measurement ID
  • Create a Google Analytics 4 configuration tag
  • Paste the measurement ID copied in 3rd step
  • Command the tag to fire (don’t forget to select All Pages)
  • Test the setup
  • Launch/Publish the finalized changes in GTM

Does GA4 have built-in tracking features?

There is a built-in tracking feature in Google Analytics 4, though it works with selected websites only. For it to work, you need to check whether the automatic tracking is turned on or off. Mainly three video events are tracked i.e. Start, Progress, and Complete.

Tracking by other parameter events is also possible, for example, duration, title, URL, visible, percent, etc.

If your website comes under the category that doesn't respond to GA4 Youtube video triggers, or if you don’t want to use this built-in feature, then continue reading to know more.

How to track YouTube videos in Google analytics 4?

The first step is to disable the “Video Engagement tracking” option displayed in the “Enhanced measurement”. Turn it off to avoid any duplication in the data, otherwise, both google tag manager and enhanced measurement will show the same data and results.

Here are the steps to disable the same

  • Open the GA4 Admin
  • Go to Data streams
  • Select Gear icon
  • Disable video engagement tracking

Now let’s go ahead and understand the process to track YouTube videos with Google tag manager and Google analytics 4. The process briefly consists of 4 steps -

  • YouTube video trigger
  • Built-in video variable
  • Google Analytics 4 tag
  • Testing

What is the process?

YouTube video trigger

The first step is to create a youtube video trigger. Open the google tag manager, find “triggers”, then the “new” tab, go straight to “trigger configuration” and select “youtube video”.

Here you will find 2 properties to select from:

  • Capture - 4 checkboxes are given i.e. start, complete, pause seeking & buffering, and progress. You can enable whichever track you would like to use, either one or all.

Percentages and time thresholds heading is also given. You can insert any number of percentage thresholds, just separate it with a comma.

  • Advanced - A checkbox to add JavaScript API support to all YouTube videos are provided. Whether to use this trigger on all videos or some videos, this option is also available.

Built-in video variables

After deciding on the configuration of the youtube video trigger, enable the built-in video variables. Go to google tag manager, left-click on “variables”, then select “configure”. A list of all video-related variables will appear.

This list will contain

  • Video title
  • Video duration
  • Video percent
  • Video URL
  • Video provider
  • Video current time
  • Video visible
  • Video status

You can choose either of them or all, depending on your requirement.

Google Analytics 4 tag

After finalizing the data, the third step is to send all this data to google analytics for further processing. Follow the steps-

  • Open google tag manager
  • Find the “tags”
  • Left-click on “new”
  • Choose the GA4 event tag

The “GA4 event” tag window will show four main headings that you have to fill. These headings are - Tag type, configuration tag, event name, and event parameters. You can re-write the event name as you want or can also follow the Enhanced Measurement naming convention.

You have to decide as per your research report which event parameters are relevant to your research and analysis. It will be a waste of time to include all parameters if you can’t figure out which part of the content users are liking more and which they are skipping.


Testing is the process performed just before the launching of the tag on the page. It is a preview of the action. Test the setup in the Preview and Debug mode.

Go to Preview and Debug Mode. Open the web page that contains the youtube video and start watching. In the preview mode, you will find the youtube video events. Click on it and see whether google analytics has fired this tag or not. If the tag is fired, “succeeded” will be written in front of the tag.

If the Youtube video event is still not showing in the summary, then you have to follow the troubleshooting guide to find what’s wrong in the above three steps.

If you have to check the incoming events or responses for your trigger, click on the “google analytics 4 debug view”. Within 24 hours your youtube video data will be seen in the standard google analytics reports and analysis hub.


There are many articles online that tell how to track youtube videos in google analytics 4. But here is the most simple and summarized method to implement, if you are just a beginner or don't want to get into nitty-gritty details (not relevant to your work).

First, try the built-in google analytics youtube video tracking feature. It is easy to use, you won’t have to manually fill the boxes and just read the report at the end of the day.

If the built-in feature is not up to the required standard or doesn’t provide the relevant and required data, then you can follow the above-mentioned steps and create and customize your YouTube video trigger, then find and insert the video variables as per the content demand, then create a google analytics 4 tag by inserting variables and other information. Finally, do the testing process before putting the tag into action.