Track video views with Google Tag Manager
Google Tag Manager (GTM) allows you to quickly and easily update segments of code from third-party vendors (collectively known as "tags") on your websites and mobile apps.
With GTM, you no longer need to add tags directly to your projects. Instead, once the GTM code has been added to your project, you can configure tags and how they deploy on your websites from within the Google Tag Manager.
This article will show you how to configure GTM so that when a Vidyard player is present on a webpage, a script will be added that utilizes Vidyard's Progress Events API to push milestone data (% of video viewed) to Google Analytics (GA).
Install Google Tag Manager
Google Tag Manager needs to be added to the webpage where you've embedded your video to track viewing data.
- Go the Google Tag Manager website, then select Admin > Install Google Tag Manager
- Copy the code provided onto your webpage, following the instructions provided by Google
Find your Google Analytics Measurement ID
To complete the Google Tag Manager setup process, you'll need to acquire your Google Analytics Measurement ID.
-
Sign in to your Google Analytics account, then select Admin
- Select Data collection and modification > Data streams, then select a data stream to acquire the measurement ID
- Copy your Measurement ID, which appears in the format
"G-"
Set up your tags, triggers, and variables in GTM
The steps below will walk you through how to import our pre-made GTM .json
container into your Google Tag Manager, which provides the tags, triggers, and variables you need to track viewing data. After importing this container, set up your tags and variables with your Google Analytics Measurement ID to ensure your data flows properly.
Download and import the GTM container
- Download the GTM container
.json
file to get started - Sign in to your GTM account, then go to Admin > Import Container
- Select Choose Container file, and choose the
.json
file from Step 1 - Choose either New or Existing Workspace (depending on your needs)
- Select Merge to keep the built-in variables from the GTM container you downloaded
- Do not choose Overwrite, as this option deletes the contents of the container
Set up variables and tags with your Google Analytics Measurement ID
- Select Workspace > Variables, then select Web Property ID under User-Defined Variables
- Use the icon to enter your Measurement ID ("G-") under Variable Configuration > Value, then Save when finished
- Select Workspace > Tags, then select Google Analytics GA4 Configuration
- Use the icon to enter your Measurement ID ("G-") under Tag Configuration > Tag ID, then Save when finished
- If you already have a tag called Google Analytics GA4 Configuration, you can delete the tag that was added with the
.json
container to avoid duplicates - The Vidyard Listener Tag (Workspace > Tags > Vidyard Listener) contains custom HTML coded console logs to assist in troubleshooting. These are optional, and can be removed if unnecessary.
- If you already have a tag called Google Analytics GA4 Configuration, you can delete the tag that was added with the
- Select Submit on the GTM main page to save your changes, then Publish to push them to your Google Tag Manager