Learn business growth with Google Analytics 4 Forums Google Analytics 4 Implementing Cross-Domain Analytics for an Embedded iframe Reply To: Implementing Cross-Domain Analytics for an Embedded iframe

  • Alexander

    21 June 2023 at 5:43 am

    This seems like a complex issue and there could be a few reasons why this is happening. The issue could be related to the domain settings of the cookies. Cookies are domain-specific and they can’t be shared or accessed by different domains by default. If the parent page and iFrame have different domains, they would be treated as separate users by Google Analytics, even if the _ga and ga cookie values are the same.

    Second, there might be issues with the way you’re passing the client_id and session_id from the parent page to the iframe. If the parent page and iframe are on different domains, you might need to use postMessage API to send the client_id and session_id to the iframe.

    Lastly, Google Analytics uses a variety of data sources to identify users, which are beyond just client_id and session_id. Issues like ad-blockers or privacy settings in user’s browser can interfere with the ability to track users accurately across pages.

    So, you might want to recheck the domain settings, how you’re passing the identifiers between parent and iframe pages, and potential impact of browser privacy settings or ad-blockers.