Skip to content
Start now

Automatically measure YouTube videos

Tips & Tricks
1 min Reading time
Content
Automatically measure YouTube videos

by 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.

As data is transmitted to Google when YouTube videos are played, consent should be obtained in advance. This can be implemented quickly and easily using the etracker consent manager ‘s block external content function, see:

https://www.etracker.com/datenschutz-im-griff-externe-inhalte-einfach-blockieren/

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 know how well it is received on the website. This is done automatically in etracker analytics by default thanks to automatic event recording. Under Account → Automatic recording → 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 evaluated with the specific key figures for playable media such as the number of starts and stops and the average playing time.

More on the topic