You’re right to suspect the iframe is part of the issue—standard embedded YouTube videos don’t expose playback data to GTM by default. However, this is a well-known use case, and GTM provides a solid way to track YouTube interactions using the YouTube Video trigger.
Here’s a step-by-step approach you can try:
-
Ensure your YouTube videos are embedded using the standard <iframe> embed code from YouTube (not a custom wrapper).
-
In GTM, go to Triggers and create a new one:
-
Type: YouTube Video
-
Configure which actions to track (start, complete, pause, etc.)
-
Optionally enable checkboxes for “capture progress” or define thresholds (e.g. 25%, 50%, etc.).
-
In GTM, create a Tag to fire when that trigger activates—e.g., a Google Analytics 4 event tag or a custom event for another platform.
-
Publish and test using GTM’s Preview mode. If the trigger doesn’t fire, ensure the iframe doesn’t have the ?enablejsapi=1 parameter missing. You might need to update the embed URL to include it, like:
https://www.youtube.com/embed/VIDEO_ID?enablejsapi=1
If you’re embedding the videos dynamically or via a CMS, you may also need to add a slight delay or use a Custom HTML tag to enhance compatibility.