Learn business growth with Google Analytics 4 Forums Google Analytics 4 Solving Safari ITP's Impact on Google Analytics in iframe scenarios

  • Solving Safari ITP's Impact on Google Analytics in iframe scenarios

    Posted by Emma on 10 November 2022 at 3:59 pm

    Hey there, I need a bit of help with Google Analytics in Safari. So, here’s the deal: I’ve got my application running in an iframe from ‘https://iframe-domain.com’, which is embedded on my main site ‘https://parent-domain.com’. I managed to set up Google Analytics and Google Tag Manager using the configuration ‘cookie_flags: max-age=7200;secure;samesite=’. It’s working well across various browsers, but Safari is being a bit troublesome. I’ve found out that Safari’s Intelligent Tracking Prevention (ITP) is blocking Google Analytics. More specifically, it seems to be hindering the third-party cookies due to the cross-origin iframe. This is something I’ve encountered in mobile Safari specifically, I’m still unsure about desktop Safari. I’m using GA version 4. Do you have any workaround for this? I really don’t want to lose all the analytics data from my Safari users.

    Skyler replied 11 months ago 3 Members · 2 Replies
  • 2 Replies
  • Olivia

    8 February 2023 at 5:23 pm

    This issue does seem a bit complicated, but it’s not unresolvable. One of the key problems is Safari’s Intelligent Tracking Prevention (ITP) feature which aims to prevent third-party trackers from capturing information about users’ web activity. It’s stricter with third-party cookies, the ones that are used when your Google Analytics runs in an iframe.

    So here’s a possible workaround: you may want to store and pass GA (Google Analytics) data via a server, going around the third-party cookie restrictions. What this entails is creating a new, “first-party” endpoint in your back-end that can collect data from within the iframe, then pass that up to the parent page – your main site. You can then utilize this data to communicate with Google Analytics.

    This server-side approach can require more time and technical expertise. Unfortunately as of now, given Safari’s stringent policies, this could be one of the few relatively reliable solutions. You should consider reaching out to a web developer or a team familiar with your web systems, if you haven’t done so already. They probably will be able to provide you a concrete plan to set up this server-side communication for Google Analytics.

  • Skyler

    10 March 2023 at 7:37 am

    Yes, it is true that Safari’s Intelligent Tracking Prevention (ITP) can interfere with Google Analytics because it limits the use of third-party cookies, which are crucial in tracking user behavior. Unfortunately, there’s no easy fix for this considering the restrictions placed by Safari, but some workarounds have been suggested within the analytics community.

    A common suggestion is to use first-party cookies instead of third-party ones, as ITP primarily aims to block the latter. There are also ways to implement so-called “cookieless tracking”, although this can get rather technical and may not provide as big a data set as traditional cookie-based tracking.

    Another workaround is to use server-side tagging, which means sending analytics data directly from your web server rather than from the user’s browser. Google’s newer analytics software, Google Analytics 4, offers this feature, although it requires a good deal of technical setup.

    Remember that the aim of platforms like ITP is to protect user privacy, so any workaround should respect that goal too. It is advisable to follow industry and legal standards relating to privacy and user data. For a complete solution, it might be best to consult with a web developer or digital marketing professional.

Log in to reply.