How to Add Google Analytics to Shopify
Connect Google Analytics 4 to your Shopify store using the official channel so ecommerce events track properly.
Google Analytics 4 tells you where visitors come from and what they do. Shopify now connects to GA4 through the Google and YouTube channel, which is more reliable than pasting code into your theme.
Create a GA4 property
In Google Analytics create a property for your store, then create a web data stream using your storefront domain. Copy the measurement ID, which starts with G-.
Install the Google and YouTube channel
In your Shopify admin open the Shopify App Store and install Google and YouTube, then connect your Google account.
Connect your GA4 property
In the channel settings, choose Google Analytics and select the GA4 property and data stream you created.
Confirm customer privacy settings
Go to Settings, then Customer privacy, and configure your cookie banner and data collection region rules so consent is respected.
Verify tracking
Open GA4 Realtime, visit your store in another browser, and confirm the pageview appears. Then add to cart and confirm the event fires.
Note
Avoid installing GA4 twice, for example through the channel and a theme snippet. Duplicate tags double-count sessions and purchases.
Still stuck? Skip the tutorials.
You've given it a go. If you'd rather have someone sort it out for you, tell us what you need and we'll take it from there.
Get Help With My Shopify StoreExpert help provided by PromptSites.com.
Related tutorials
How to Add the Meta Pixel to Shopify
Install the Meta pixel and Conversions API through the official Facebook and Instagram channel, then verify events.
Read more elsewhere
Shopify Help Center: Analytics and reports
Explains what each Shopify report measures and how sessions, conversion rate and attribution are calculated.
Link to an external site. We don't republish other people's content.

