Important: if you are looking for a recipe that supports Universal Analytics, go here
This Google Tag Manager Recipe is based on the auto-event listener created by David Vallejo (but with some modifications by Julius Fedorovicius).
What does it do? Automatically tracks interactions of embedded HTML5 video player on your site. This recipe will fire events to Google Analytics 4 when users Play, Pause, and view 25, 50, 75, and 100% of the video.
Read the blog post on how this recipe is created.
- Download Container File
Download the container JSON file (right-click on the link and click “Save Link As” or “Save Target As” to save the JSON file to your computer).
- Import JSON File into GTM
Log into your own Google Tag Manager container and head to the Admin section of the site. Under Container options, select Import Container. Read this blog post for more details about importing a container file.
- Insert your own GA4 configuration tag
In the GA4 event tag, you will find a field called “Configuration tag”. In this field, select your own GA4 configuration that you already have in the container. New to GA4 config tag? Read this guide.
- Preview & Publish
Use the Preview options to test this container on your own site. Try testing each of the events to make sure they’re working properly. If everything looks good, go ahead and publish!
- Want to see event parameters in your regular GA4 reports or Analysis Hub?
Register them as custom dimensions.