In this chapter, we’ll show you how to set up a handy tag for collecting data from YouTube videos embedded on your site or app. The collected data will include plays, rewinds, pauses, mutes, watch time, progress and more.
To set up a YouTube video tracking tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name the tag and select the following type: YouTube video tracking.
- Click Next.
- (Optional) Turn on Track progress and set up percentages.
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will fire only for visitors who accept the selected consent type.
- Respect opt-out and DNT is turned on by default. Leave it as is if you want to respect visitors who’ve turned on the Do-Not-Track feature in their browsers or who’ve opted out of tracking using our opt-out form.
- In Flight dates, set the date and time when the tag is fired.
- In Tag triggers, click Choose existing trigger.
- Choose the following trigger: All page views.
Note: You can also set a new trigger that will fire this tag on selected pages.
- When you’re done, click Save for the trigger.
- Click Save for the tag.
- Click Debug and check if your tag is fired correctly.
Note: The YouTube video tracking tag runs a complex script that collects various pieces of video data and sends them to Analytics. You just need to make sure that the tag fires on the pages with videos. The script will take care of everything else.
- When you’re happy with how the tag works, click Publish.
- You can quickly check if data is collected correctly by going to Menu > Analytics > Settings > Tracker debugger.
Note: Data in the tracker debugger appears instantly. Data in reports appears in about 30 minutes.
- After data is collected, you’ll see it under Menu > Analytics > Reports > Video analytics.
Note: For HTML5 videos use our dedicated HTML5 video tracking tag. For Vimeo videos, use a dedicated custom code.