Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1303486

    Google Analytics GA4 has the ability to track youtube video interactions.
    This is possible if the Youtube video is embedded directly into the page.

    RE: https://www.youtube.com/watch?v=co1HIvDk57E&t=125s

    However, when the video is open in the Magnific modal Pop-up the video is embedded into an iFrame. class=”mfp-iframe”

    An iFrame as separate web entity to the parent website. Therefore a standard implementation of google analytics or via Google Tag Manager GTM, will not track the youtube events from within the iFrame.

    A custom event listener is required to pass events from the VIDEO iframe analytics account to the Parent analytics account.
    REF: https://www.youtube.com/watch?v=yIWkcMvrpC0&t=684s

    – – – – – – – – – – – – – – – – – – – – –
    After reviewing multiple suggestions. I think it would be easier if the iframe body in the modal window also included the same parent website google analytics tracking.

    I have implemented GOOGLE TAG MANGER using a hook.

    https://kriesi.at/support/topic/google-tag-manager-6/#post-1063644

    Other than editing the Enfold Theme Source code to directly and add the GTM implementation to the iframe output.

    I’d like to know if there is a hook specifically for the video Iframe so I can do this from the child theme.

    If there is no hook currently available. Which file do I need to copy from the parent theme to the child theme and how to I register this copy version to the Child theme.

    I look forward to your feedback

    #1303763

    Hey HuxburyQuinn,

    Thank you for the inquiry.

    Does it work properly when you instead open an inline content or an external URL containing the video? You can open a site page or URL in the lightbox by prepending the iframe=true parameter to it.

    Opening an inline popup: https://kriesi.at/support/topic/contact-form-popup-3/#post-992715

    Unfortunately, as you said yourself, the iframe is a different web entity that is completely separate to the parent site, so injecting the same GA tag to the iframe may not be possible without significant code modification.

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.