Automatically measure YouTube videos
von Katrin Nebermann
Automatically measure YouTube videos
YouTube videos can be easily integrated into a website. All you need is the appropriate HTML code, which you can obtain using the Share → Embed function. It is essential to ensure that the option Activate extended data protection mode is used. In addition, you can customize the design and playback mode using various parameters and enable responsive display via CSS. As data is transmitted to Google when YouTube videos are played, consent should be obtained in advance. This can be implemented with so-called dynamic content blocking, for example with the consentmanager, see
https://help.consentmanager.net/books/cmp/page/dynamic-content-blocking
First, load the YouTube API on the page of the video. You do this with the following script line:
<script src="https://www.youtube.com/iframe_api"></script>
This query parameter must then be appended to the URL of the video to be measured:
enablejsapi=1
Example:
<iframe id="yt" width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY?enablejsapi=1"></iframe>
Once the video has been created, uploaded and integrated, you naturally want to measure how well it is received on the website. This is done automatically by default in etracker Analytics. Under Settings → Account → Automatic recording of events, you only need to check the box for Playable media (videos, podcasts, music). The respective video is recorded as an object with a name and corresponding URL.
In the events report, the videos can be analyzed with the specific key figures for playable media such as the number of starts and stops and the average playing time.
Data protection under control: simply block external content