What is the required code to track HTML5 video play event in Google Analytics?

1.1k Views Asked by At

This is the first time I need to track a video play event in my website. I did something in Google Analytics to define a goal in this regard. Now, I need to know how can I detect the video play action and send related information to Google Analytics?
May you help me or give me some links for this purpose? Unfortunately, I couldn't find the appropriate documents for it yet.

1

There are 1 best solutions below

0
Michele Pisani On

For Universal Analycs there are several article to track HTML video. You can follow this guidelines: https://www.thyngster.com/tracking-html5-videos-gtm

For GA4 there are no definite specifications, as the version is still very unripe and will undergo further changes in the coming months, so if you have only installed the GA4 version of Google Analytics I strongly recommend that you put it in parallel with the Universal one.

Anyway, you can try to modify the code of the link that I have indicated and use the 'case' play and its event name (gaEvent) as a trigger to send a custom event with the Tag for Google Analytics 4.