YouTube video tracking tag not working in hidden modals

Hi all.
we have implemented Youtube video tracking tag and it works as expected when we have youtube videos embedded directly on webpage.
however we have some webpages which has a gallery of youtube videos, basicly it is a list of thumbnails and when the thumbnails are clicked they open a modal which embeds the clicked youtube video in the modal. we do this to improve perfomance when the webpage loads.
the problem is the Youtube video tracking is not working on these videos. anyone know if there is a solution to this ?

Hi. You would have to trigger the video tracking tag once again. All the listeners are applied to videos while loading this tag. Since the player was not embedded on the website at this point, the integration is not set up. Try to trigger the code after opening the video once again. Hope it won’t duplicate events for all others. In the meantime I’ll ask the dev team to test this use case.

Thank you kuba.
i have tried to trigger the video again using an element presence trigger as well but it did not seem to work. how can i trigger the code from the website ? the video embed is happening in a bootstrap modal show event called

The code should be visible in tag manager debugger. Try to copy it and execute on a page with the video element you’re referring to (you can use browser’s console → console tab). If the tracking starts to work, it’ll be just a matter of adjusting the trigger.

i found the script code and added it inside the modal that opens, but it still does not work, sadly.

Thanks for feedback. I provided all needed info to our devs. They will try to figure out the officially recommended solution.