Place dummy div container on your page where you want the YouTube Videos to appear. Add unique id attributes to each dummy container. The YouTube embed API, which we have to use in order to track media interactions, will replace those empty div containers with the video player.

Insert the code that you find on the example page mention above or that you can download at the bottom of this page. In the playerInfoList array you need to enter all the information of the videos that you want to embed on your page. Have a look at the source code of the example page to get an idea about the properties.

That’s it! Now when a visitor starts a video, a mediarequest is fired. Every few seconds a pos request is fired, containing the current position, and when the visitor seeks, corresponding requests for that action are triggered.