How to resolve GA4 Pixel tracking issue on checkout pages?

Topic summary

GA4 events on Shopify checkout were not firing due to Content Security Policy (CSP) blocking Google endpoints (e.g., analytics.google.com, region-specific collectors). Impacted events included page_view, begin_checkout, and add_payment_info. Console errors and posted CSP headers showed missing connect-src allowances for *.google-analytics.com and *.analytics.google.com.

Workarounds reported:

  • Custom pixel using Shopify analytics events, then pushing to gtag with transport_url set to https://www.google-analytics.com.
  • Thank-you page tagging for conversions when checkout tracking isn’t possible.
  • GTM remains restricted at checkout for non‑Plus stores; theme.liquid edits do not affect checkout.

Reference documentation from Google specified required CSP directives for GA4 (script/img/connect-src to *.googletagmanager.com, *.google-analytics.com, *.analytics.google.com, and, with Signals, additional Google domains).

Vendor responses and outcome:

  • Shopify initially directed merchants to Google; community argued Shopify must update checkout CSP.
  • Multiple users reported a fix rolled out around April 11–13, 2023. Later updates note 90–100% conversion match via native GA4, and reduced discrepancies (~10%) for manual dataLayer setups, suggesting a Shopify-side update.

Current state: Largely resolved for native integration, but some still see missing purchase events (e.g., iDEAL/system-browser flows). Discussion remains open for edge cases.

Summarized with AI on December 15. AI used: gpt-5.

UPDATE:

I’ve been talking with Google and had a call with them. They were confused why the tag wasn’t firing correctly even after correct installation. We ran out of time and had to reschedule for another appt. I was able to get ahold of Shopify about the CSP issue and they told me Google tag manager won’t work on any shopify stores that aren’t on a shopify plus plan. We’ve had our same plan since 2015 and have been grandfathered in with really good rates and things, so we have no interest in swapping to a different plan that does little for us aside from making us pay more for less. However, this poses a serious issue now that we can’t connect our site to GA4. Don’t know if anyone else is on a custom plan too, or even just not a shopify plus one, but just throwing it out there as another potential to look at for anyone else still struggling with this.