YouTube video tracking has now become easier since the release of built-in video trigger in Google Tag Manager. If you are looking to track embedded YouTube videos, this guide is for you.
Without wasting time explaining the same things, let's face the new video trigger and variables. Follow the steps below:
Step1: Enable Built-in Video Variables
Before doing anything specific, click on variables and enable all the new video built-in variables.
Step2: Create & Configure Video Trigger
Open triggers tab and click on the new button to create a new trigger.
Enter a unique name for the trigger, click trigger configuration, and select YouTube Video as the trigger type.
Configure the trigger as displayed in the image below. You can uncheck the options you don’t want to track.
The first three things in the above image are understood.
You can track the video progress in two ways. The first is by percentages, and second by time thresholds. Both are used to track how long a video has been played.
In the advanced section, by checking the ‘Add JavaScript API support to all YouTube videos’ will fire the trigger on videos that have JS API support.
Once you configure this, save the trigger.
Step3: Create YouTube Video Tag
Now, navigate to tags section and create a new Google Analytics tag.
Configure the tag as displayed in the image below.
You will use the video variables you have enabled in the step to send event data to Google Analytics.
Add the trigger we created in the second step to this tag.
Save tag and open preview mode. Open your web page containing the video in a new tab.
If you have done the above steps carefully, the YouTube event will fire.
Now that we have confirmed video tracking is working successfully. You can now publish changes in Google Tag Manager.
If you have any questions related to this article, please ping us on Twitter or share if you find this helpful.