Youtube Video Tracking issue | Community
Skip to main content
Level 2
April 1, 2026
Question

Youtube Video Tracking issue

  • April 1, 2026
  • 2 replies
  • 63 views

Hi Guys,

 

We have 2 types of Youtube Videos:

  1. iframe based youtubevideo which plays inline: Here Tracking works fine with Adobe extension “Video Tracking for YouTube”.
  2. iframe based youtube video which plays with a Modal Popup.: Tracking doesn’t work when user Clicks on Video, Modal opens and video starts playing in Modal. 

What recommendations do you have so that the tracking for Modal Youtube videos also starts working?

 

 

Thanks,

Nitin

 

    2 replies

    bjoern__koth
    Community Advisor and Adobe Champion
    Community Advisor and Adobe Champion
    April 1, 2026

    HI ​@Nitin3432434 

    typically, this is a timing issue if the player is not present when the library loads.

    I typically use the Youtube Playback extension which allows you to load the library on demand i.e., you specify when it loads, to make sure to capture the injected player only when it becomes visible.

     

     

    Cheers from Switzerland!
    Level 2
    April 1, 2026

    Hi ​@Nitin3432434 

     

    The issue is likely a race condition: the YouTube extension looks for iframes when the page loads, but your modal iframe is injected into the DOM dynamically later.

    The Fix:

    1. Trigger a Re-initialization: In your Adobe Tags rule that opens the modal, add a Custom Code action after the modal is visible. Use the extension’s internal function (if available) or a native script to attach the listener to the new iframe.
    2. Enable 'JS API' in the URL: Ensure the YouTube URL inside your modal iframe includes the parameter ?enablejsapi=1. Without this, the extension cannot communicate with the player.
    3. Check the 'ID' Attribute: Ensure the iframe in the modal has a unique id. The YouTube API requires this to track the specific player instance.

    If you are using a common modal library (like Bootstrap or Slick), trigger the tracking script on the shown event of the modal!

     

    Please let me know once work.

     

    Thanks,

    Santosh Kumar

    Santosh Kumar | AEP & CJA Expert
    Level 2
    April 2, 2026

    @santoshkr Does this need all 3 fixes to be done in order to resolve or last 2 items if implemented will resolve the issue? Also, could you be more specific with step 1 on what exactly needs to be done here?

    Level 2
    April 6, 2026

    Hi ​@Nitin3432434 

     

    You can use any one of the three steps mentioned above. The key is to trigger the event when the modal becomes visible. This can be done using a CSS selector like an ID or class.

    Adobe Launch also supports listening to events using DOM-based detection, so please try that approach—it should work.

     

    Thanks,
    Santosh Kumar

    Santosh Kumar | AEP & CJA Expert