How do I install Google Analytics 4 on Shopify?
Updated
Install the Google & YouTube app, connect your Google account and link your GA4 property in the app. It then sends page views, product views, cart, checkout and purchase events for you, with no code in your theme.
Google recommends the app for Google measurement on Shopify. It runs as a pixel in Settings, then Customer events, so it also works on checkout and the Thank you page, where theme code doesn't run.
The usual problem is an old GA4 tag still running next to the app, in the theme, a custom pixel or Google Tag Manager. Each one sends its own purchase, so GA4 counts the same order more than once. Google also said Shopify would turn GA4 setups not moved into the app by 2 February 2025 into a custom pixel, which may still be running.

Check it yourself
- 1
In GA4, check you have a property with a web data stream for your store's domain, and note its measurement ID, which starts with G-.
- 2
Install the Google & YouTube app from the Shopify App Store and connect the Google account that has access to that property.
- 3
In the app, click Get started in the Google Analytics box, choose your property and click Connect. Check the measurement ID shown matches the one in GA4.
- 4
Go to Settings, then Customer events, and look for custom pixels that also load GA4. Check theme.liquid and Google Tag Manager for older GA4 tags too, and remove any that send the same events.
- 5
Place a test order and watch the Realtime report in GA4 for the purchase event. Standard reports can take 24 to 48 hours to fill in.
- 6
If you sell to the EEA, the UK or Switzerland, set up your cookie banner in Settings, then Customer privacy, so GA4 receives consent signals.
When to ask for help
If GA4 shows no purchase after a test order, or two purchases for one order, ask for help before you add another tag. Adding tags usually makes the counting worse.