Note: For versions below 16.5.0, use a custom code for HTML video tracking.
An HTML5 video tracking tag lets you collect data on user interactions with HTML5 videos on your site or app. Once it’s set up, you can view the collected data in your video analytics reports.
To create and set up the HTML5 video tracking tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Select the following type: HTML5 video tracking and click Next.
- Name your tag.
- Set up the following elements:
- Track progress: If turned on, you’ll track percentage thresholds and interaction timestamps.
- Track only videos with the selected CSS selectors: If turned on, you’ll only track videos that have the selected CSS selectors.
- Read video titles from an HTML attribute: If turned on, you’ll use an HTML attribute to read the titles of tracked videos.
- Track the volume level as a custom dimension: If turned on, you’ll track the volume level as a percentage. It’ll be stored as a custom dimension.
Note: If you turn it on, create a custom dimension under Analytics > Settings > Custom dimension and enter the dimension name or ID here.
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will only fire 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 will fire.
- 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.
- Click Save to save the tag.
- Test your tag in debug mode.
- When you’re happy with how the tag works, click Publish.
- Done! After a while, collected data will appear in Menu > Analytics > Reports > Video analytics.