Video Tracking via YouTube Video Trigger In Google Tag Manager

Today I am going to show you,……..how to use the new YouTube Video trigger in Google Tag Manager,……to track YouTube Videos embedded on a webpage.

Introduction to Video Tracking

The tracking method which is used to track/capture the various player states of an embedded video is called ‘video tracking’.

A player state is a specific user interaction with a video.

Following are the example of various player states which can be captured for YouTube videos via GTM:

#1 Start – denotes video being playing.

#2 Pause – denotes video is paused.

#3 Seek – denotes scrub bar is moved to seek or reposition timing within a video.

#4 Buffering – denotes video buffering / downloading.

#5 Progress – denotes the progress of a specific video by percentage or time threshold.

For example, if 5% of the total video length has been played then the value of Progress can be 5%.

Similarly, if 10 seconds of video has been played then the the value of Progress can be 10 seconds.

#6 Complete – denotes a video finished playing.

Get the E-Book (62 Pages)

Setting up Video Tracking via YouTube Video Trigger In Google Tag Manager

Follow the steps below:

Step-1: Login to your Google Tag Manager (GTM) account and then click on the ‘Folders’ tab:

Step-2: Click on the ‘New Folder’ button.

Step-3: Name your new folder ‘YouTube Video Tracking’ and then click on the ‘create’ button.

We are going to use this folder to store all tags, triggers and variables related to YouTube Video tracking.

Step-4: Click on the ‘Variables’ tab:

Step-5: Click on the ‘Configure’ button:

Step-6: Scroll down and then select all the built-in variables related to videos:

  1. Video Provider
  2. Video Status
  3. Video URL
  4. Video Title
  5. Video Duration
  6. Video Current Time
  7. Video Percent
  8. Video Visible

Step-7: Click on the ‘New’ button under ‘User Defined Variables’ column:

Step-8: Create a new dataLayer variable with following configurations and then move the variable to the folder named ‘YouTube Video Tracking’:

This dataLayer variable is used to pull the value of gtm.videoElapsedTime from the dataLayer.

The gtm.videoElapsedTime dataLayer variable reports on the time elapsed (in seconds) since the last time a video was paused or buffered.

Later when we create a new universal analytics tag to send video tracking data to GTM, we are going to call this dataLayer variable within the tag.

Step-9: Create a new lookup table variable (name it ‘Video Player State’) with following configurations and then move the variable to the folder named ‘YouTube Video Tracking’:

I have created this variable to rewrite the outputs of the ‘video status’ variable.

The ‘video status’ variable is a built-in GTM variable which returns the current video player state.

By re-writing the values of the current player state, I am making the video tracking report in Google Analytics more meaningful for the end users (like my clients) who might not understand what ‘progress’ mean or what ‘start’ stands for etc.

Step-10: Click on the ‘Triggers’ tab:

Step-11: Click on the ‘New’ button to create a new trigger.

Step-12: Name your new trigger as ‘YouTube Video Trigger’ and then move the trigger to the folder named ‘YouTube Video Tracking’ (by clicking on the folder icon next to the trigger name):

Step-13: Choose ‘YouTube Video’ as trigger type:

Your screen should now look like the one below:

Step-14: At this point you need to decide you video tracking setup:

  • Whether or not you want to measure ‘Pause’, ‘Seeking’, ‘Buffering’ and/or ‘Progress’ Player states.
  • When the progress of videos should be measured?
  • How the progress of videos should be measured? In terms of percentages or time thresholds?
  • Whether or not you want to add JavaScript API support to all YouTube videos
  • What pages the ‘YouTube Video’ trigger should fire.

You can either decide your own video tracking setup or you can use the one I use:

Here,

I am measuring all available player states of a YouTube Video.

The progress of my videos should be measured whenever a user passes the following percentage thresholds: 10,25,50,75,90

Add JavaScript API support to all YouTube videos.

The YouTube Video Trigger’ will fire on all pages of my website.

Step-15: Click on the ‘Save’ button to complete the creation of the new trigger.

Step-16: Click on the ‘Tags’ tab:

Step-17: Click on the ‘New’ button to create a new tag.

Step-18: Name the new tag ‘Send YouTube Video Tracking data to GA’ and then move it to the folder named ‘YouTube Video Tracking’.

Step-19: Set up the new tag with following configuration:

We are going to use this tag to send the Video tracking data to Google Analytics.

Step-20: Set the firing trigger of the ‘Send YouTube Video Tracking data to GA tag to the ‘YouTube Video Trigger’ we created earlier:

Step-21: Click on the ‘Save’ button to complete the tag set up.

Step-22: Click on the ‘Preview’ button (on the top right hand side) to preview and test your new video tracking setup:

Step-23: Navigate to the web page on your website where you want to test your new video tracking setup and which has got a YouTube video embedded on the page.

You should see a ‘preview’ window at the bottom of your browser window:

Step-24: Now play, pause and/or seek the embedded YouTube video.

As you interact with the video player, you should see the new ‘gtm.video’ event(s) being listed….one after the other under the ‘Summary’ column:

Step-25: Click on one of the ‘gtm.video’ events and then click on the ‘Data Layer’ tab:

Step-26: Now look at the values of following data layer variables:

Here,

gtm.video‘ is the name of the event that activates the YouTube Video trigger.

gtm.videoProvider‘ variable returns the name of the video platform whose videos you are tracking. Its value is ‘youtube’.

gtm.videoStatus‘ variable returns the current player state of a video. Its values can be: start, complete, pause, seek, buffering and progress.

gtm.videoUrl‘ variable returns the URL of the embedded video.

gtm.videoTitle‘ variable returns the the title of the embedded video.

gtm.videoDuration‘ variable returns the total length of the embedded video in seconds.

gtm.videoCurrentTime‘ variable returns the time (in seconds) where a user was when the last video event fired.

gtm.videoElapsedTime‘ variable returns the time elapsed (in seconds) since the last time the video was paused or buffering.

gtm.videoPercent‘ variable returns the percentage of the total video length where a user was when the last video event fired.

gtm.videoVisible‘ variable returns either true or false, depending on whether or not the embedded video was visible in the viewport when the last video event fired.

If you see the values of the data layer variables then it means, YouTube video tracking is working correctly.

Step-27: Navigate back to your GTM account and then click on the ‘Leave Preview mode’ button:

Step-28: Click on the ‘submit’ button (on the top right hand side):

Step-29: Enter your version name and then click on the ‘Publish’ button.

Step-30: Navigate back to the web page on your website which has got a YouTube video embedded on the page. Now play, pause and/or seek the embedded YouTube video.

Step-31: Wait for 10-15 minutes and then navigate to ‘Behavior’ > ‘Events’ > ‘Top Events’ report in your Google Analytics view:

Step-32: Find and click on ‘YouTube Videos Tracking’ event category:

In this event category you can find all of your video tracking data:

You can also track YouTube videos without using the YouTube video trigger.

To learn more about this tracking method, read this article: YouTube video tracking via Google Tag Manager

Other Articles on Specialised Tracking in Google Analytics

  1. Google Analytics Recurring Revenue and Subscriptions Tracking Guide
  2. How to track the impact of cookie consent on website traffic in Google Analytics
  3. Phone Call Tracking in Google Analytics and Beyond
  4. Scroll Tracking via Scroll Depth Trigger in Google Tag Manager
  5. Video Tracking via YouTube Video Trigger In Google Tag Manager
  6. Calculated Metrics in Google Analytics – Complete Guide
  7. The one thing that you don’t know about PayPal.com and the referral exclusion list
  8. Introduction to Postbacks in Google Analytics
  9. Creating Content Group in Google Analytics via tracking code using gtag.js
  10. Tracking Site Search without Query Parameter in Google Tag Manager
  11. Setting Up Site Search Tracking for POST based search engines in Google Analytics
  12. Tracking Site Search for GET-Based Search Engines in Google Analytics
  13. Understanding site search tracking in Google Analytics
  14. Tracking Virtual Pageviews in Google Tag Manager – Complete Guide
  15. Creating and using Site Search Funnel in Google Analytics
  16. Learn to Setup Facebook Pixel Tracking via Google Tag Manager
  17. How to use Keyword Hero to reveal Not Provided keywords in Google Analytics
  18. Guide to Event Tracking via Google Tag Manager
  19. Learn to track Qualified and Won leads in Google Analytics
  20. Creating your own Google Analytics Tag Auditing System
  21. Using multiple Google Analytics tracking codes on web pages
  22. Guide to Offline Conversion Tracking in Google Analytics
  23. Google Analytics and YouTube Integration Guide
  24. Complete Guide to Google Analytics for Facebook
  25. Tracking true referrals in Google Analytics when using PayPal and other payment gateways
  26. Virtual pageviews in Google Analytics – Complete Guide
  27. YouTube Video tracking via Google Tag Manager
  28. Implementing E-Commerce Tracking via Google Tag Manager
  29. Event Tracking in Google Analytics – Complete Guide
  30. E-Commerce Tracking in Google Analytics – Complete Guide
  31. Google Analytics Cross Domain Tracking Explained Like Never Before
  32. Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
  33. Setting up & Tracking AMP Pages in Google Analytics
  34. Setting up Sales Funnel across websites in Google Analytics
  35. Using Data Visualization to analyze the SEO Performance
  36. Tracking offline conversions in Google Adwords
  37. How to Correctly Measure Conversion Date & Time in Google Analytics
  38. Tracking Twitter and Linkedin Social Interactions in Google Analytics
  39. Implementing Scroll Tracking via Google Tag Manager
  40. Phone Call Tracking and ROI calculations – Champion’s Guide
  41. Google Analytics Cross Domain Tracking (ga.js)
  42. Open Graph Protocol for Facebook Explained with Examples
  43. How to Exclude URL Query Parameters in Google Analytics?
  44. Understanding Google Analytics Default Page Setting
  45. Implementing rollup reporting in Google Analytics
 

Do you know the difference between Digital Analytics and Google Analytics?


99.99% of course creators themselves don’t know the difference between Digital analytics, Google Analytics (GA) and Google Tag Manager (GTM).

So they are teaching GA and GTM in the name of teaching Digital analytics.

They just copy each other. Monkey see, monkey do.

But Digital analytics is not about GA, GTM.

It is about analyzing and interpreting data, setting up goals, strategies and KPIs.

It’s about creating strategic roadmap for your business.


Digital Analytics is the core skill. Google Analytics is just a tool used to implement ‘Digital Analytics’.

You can also implement ‘Digital analytics’ via other tools like ‘adobe analytics’, ‘kissmetrics’ etc.

Using Google Analytics without the good understanding of ‘Digital analytics’ is like driving around in a car, in a big city without understanding the traffic rules and road signs.

You are either likely to end up somewhere other than your destination or you get involved in an accident.


You learn data analysis and interpretation from Digital analytics and not from Google Analytics.

The direction in which your analysis will move, will determine the direction in which your marketing campaigns and eventually your company will move to get the highest possible return on investment.

You get that direction from ‘Digital analytics’ and not from ‘Google Analytics’.


You learn to set up KPIs, strategies and measurement framework for your business from ‘Digital analytics’ and not from ‘Google Analytics’.

So if you are taking a course only on 'Google Analytics’, you are learning to use one of the tools of ‘Digital analytics’. You are not learning the ‘Digital analytics’ itself.

Since any person can learn to use Google Analytics in couple of weeks, you do no get any competitive advantage in the marketplace just by knowing GA.

You need to know lot more than GA in order to work in digital analytics and marketing field.


So what I have done, if you are interested, is I have put together a completely free training that will teach you exactly how I have been able to leverage digital analytics to generate floods of news sales and customers and how you can literally copy what I have done to get similar results.

Here what You'll Learn On This FREE Web Class!


1) The number 1 reason why most marketers and business owners are not able to scale their advertising and maximise sales.

2) Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

3) The number 1 reason why conversion optimization is not working for your business.

4) How to advertise on any marketing platform for FREE with an unlimited budget.

5) How to learn and master digital analytics in record time.

 
 

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

Himanshu Sharma

Digital Marketing Consultant and Founder of Optimizesmart.com

Himanshu helps business owners and marketing professionals in generating more sales and ROI by fixing their website tracking issues, helping them understand their true customers purchase journey and helping them determine the most effective marketing channels for investment.

He has over 12 years experience in digital analytics and digital marketing.

He was nominated for the Digital Analytics Association's Awards for Excellence.

The Digital Analytics Association is a world renowned not-for-profit association which helps organisations overcome the challenges of data acquisition and application.

He is the author of four best-selling books on analytics and conversion optimization:

error: Alert: Content is protected !!