Google Tag Manager has launched in 2017 three very useful new User Engagement triggers. These triggers help you track video views, user scrolling and what your users are seeing on your pages. This post will show you step-by-step how to setup the new YouTube Video Trigger.
The YouTube Video trigger allows you to track several different user actions on videos on your website. These user actions are:
- Starting the video
- Completing the video
- Pausing the video
- Watching through a certain point in the video. These points can either be a percentage of the video length or a specific amount of time.
In this tutorial, we will show you how to setup a Google Analytics Event Tag to capture all this information. To do this we will configure a few variables, create a lookup table and setup the GA Event tag and YouTube Video trigger.
Step 1: Configure the Video Variables
Along with the new YouTube Video Trigger GTM has added several new built-in variables specifically for YouTube Videos. You will need to setup 3 of these to capture information about the videos.
- In GTM navigate to the Variables section.
- The top part of the Variables section is for Built-In Variables. In this section click the Configure button.
- In the menu that opens; scroll down and check:
- Video Status
- Video Title
- Video Percent
Step 2: Create the Video Status Lookup Table
The Video Status variable will capture what action the user has taken on the video. However, Google does not populate this variable in the most user friendly format. We will create a lookup table to rectify this.
- In the Variables section create a new User-Defined Variable.
- Click the Variable Configuration block.
- Select the variable type Lookup Table.
- Set the Input Variable to the Video Status variable.
- Add Rows and fill in the values for the Input and Output as depicted in the screenshot above. Note that the Video Watched Output field includes the Video Percent variable. This is selected by clicking the plus box on the right of the Output field.
- Give the lookup table the title: ‘Video Status Lookup Table’.
- Save the variable.
Step 3: Create the Trigger
The next step is to create the YouTube Video trigger.
- Navigate to the Triggers section of GTM and click the New button.
- Click in the Trigger Configuration Section.
- Choose YouTube Video Trigger.
- In the capture selection make sure all four checkboxes are checked:
- Pause, Seeking and Buffering
- When you check the Progress option a radio button will appear. Leave this as Percentages.
- Fill in 25,50,75 into the textbox. This will track when the user has watched 25%, 50% and 75% of your video.
- Give the trigger the title: ‘YouTube Video Trigger’.
- Save the Trigger.
Step 4: Create the Google Analytics Event Tag
The final step will be to create the tag that sends the video events to Google Analytics.
- Navigate to the Tags section of GTM.
- Click the New Button.
- Click on the Tag Configuration block.
- Choose the Universal Analytics Tag Type from the menu.
- Change the Track Type to Event using the Dropdown menu.
- In the Category field type ‘Videos‘.
- For the Action field click the Plus box on the right and select the Video Status Lookup Table variable.
- For the Label field click the Plus box on the right and select the Video Title variable.
- Under Google Analytics Settings either select your Settings Variable or Enable Overriding and insert your UA ID number.
- Click on the triggering section and select your YouTube Video trigger.
- Give your tag the title: ‘YouTube Video Tag’.
- Save the tag.
You have now completed the setup and can publish your tag. GTM will now send events to Google Analytics whenever the user starts, pauses or completes a video. It will also send an event whenever a user watches 25%, 50% and 75% of the way through your videos. This allows you to see how far through your video users are watching.
If you have any questions about the new YouTube Video Trigger and how to use it then please send me an email.