Implementing Custom Play/Pause Button for Embedded YouTube Videos Using IFrame Player API
Perficient
JANUARY 7, 2021
Recently, I worked on one bug where GTM tracking was breaking for an embedded YouTube video with a custom play button. On click of the play button, the video was playing perfectly fine, but it was not getting tracked by GTM. I didn’t find anything wrong in the code, so I did some research and found that it is recommended to use YouTube IFrame player API for any custom play/pause button whether you are doing GTM tracking on your web pages or not.
Let's personalize your content