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.

Hello @leemcd ,

I am Gina from flareAI app helping Shopify merchants get $5Million+ in sales from Google Search, on autopilot.

It’s possible that the issue you’re experiencing with the GA4 Pixel not tracking checkout pages is related to the Content Security Policy (CSP) set up on your website. The error message you’re seeing suggests that the CSP directive “connect-src” is preventing the GA4 Pixel from connecting to the analytics server.

Here are a few potential solutions you can try:

  1. Add the Google Analytics domain to the connect-src directive in your CSP
    You can add the domain “https://region1.analytics.google.com” to the connect-src directive in your website’s CSP. This will allow the GA4 Pixel to connect to the analytics server and track events on your checkout pages. For example, you could add this to your CSP header:

connect-src ‘self’ *.shopifycs.com https://region1.analytics.google.com;

  1. Modify the CSP policy in your Shopify store
    You may be able to modify the CSP policy in your Shopify store to allow the GA4 Pixel to connect to the analytics server. This can be done by editing the “content_security_policy” section of your Shopify theme’s “config/settings_data.json” file. You can add the following to the “content_security_policy” section:

“connect-src”: “‘self’ *.shopifycs.com https://region1.analytics.google.com”,

  1. Contact Shopify support
    If you’re still having trouble after trying the above solutions, you may want to contact Shopify’s support team for assistance. They may be able to help you troubleshoot the issue or escalate it to the appropriate team for further investigation.

  2. Contact Google support
    You can also try contacting Google’s support team for further assistance with the issue. They may be able to provide more specific guidance on how to resolve the CSP issue with your GA4 Pixel.

I hope these suggestions help you resolve the issue and successfully track events on your checkout pages with the GA4 Pixel.

Gina

1 Like