Tutorial

How to Add Google Analytics 4 to Shopify (2026)

Add Google Analytics 4 to Shopify with the Google & YouTube app: create a GA4 property, connect it in the app, check purchase events, avoid double counts.

On this page
  1. Step 1: Create a GA4 property and web stream
  2. Step 2: Remove any old tracking code
  3. Step 3: Install the Google & YouTube app
  4. Step 4: Connect the GA4 property
  5. Step 5: Check it in Realtime
  6. Step 6: Link Search Console and set key events
  7. Troubleshooting
  8. FAQs

To add Google Analytics 4 to Shopify, create a GA4 property and web data stream in Google Analytics, install Shopify's Google & YouTube app, connect your Google account in it and select the GA4 property. The app then sends page views and ecommerce events (view item, add to cart, begin checkout, purchase) without any code.

Time required: 20 to 30 minutes, plus up to a day for reports to fill in

What you'll need:

  • A Shopify store and staff access with permission to install apps
  • A Google account with access to Google Analytics
  • A test product you can order and refund

For what those events mean and which ones to report on, see GA4 events explained.

Step 1: Create a GA4 property and web stream

Where: analytics.google.com > Admin > Create > Property

  1. In Google Analytics click Admin (gear icon), then Create > Property.
  2. Name it after the store, set your reporting time zone and currency (the currency your store sells in).
  3. Choose Web as the platform, enter https://yourdomain.com and create the stream.
How to add Google Analytics 4 to Shopify: GA4 Admin create property screen with time zone and currency highlighted
Step 1: Create the GA4 property with the store's time zone and currency, then a Web stream.

If you already have a GA4 property for the store, skip this step and use that one.

Step 2: Remove any old tracking code

Where: Shopify admin > Online Store > Themes > Edit code > theme.liquid, and Settings > Customer events

Before connecting the app, look for an older gtag snippet (G- or UA- ID) in theme.liquid, and any custom pixel under Settings > Customer events that also sends to Google Analytics. Two setups at once count every purchase twice. Remove the old one after the app is working.

Step 3: Install the Google & YouTube app

Where: Shopify App Store > Google & YouTube

  1. In Shopify admin, open Apps and search the Shopify App Store for Google & YouTube (published by Google).
  2. Click Install and approve the permissions.
  3. In the app, click Connect Google account and sign in with the account that has GA4 access.
Shopify App Store page for the Google and YouTube app with the Install button highlighted
Step 3: Install Google & YouTube from the Shopify App Store, then connect your Google account.

Step 4: Connect the GA4 property

Where: Shopify admin > Apps > Google & YouTube > Settings > Google Analytics

  1. In the app's settings, find Google Analytics and click Connect.
  2. Select the GA4 property from Step 1 and confirm.
  3. You can skip Merchant Center and Google Ads for now if you only want analytics.

Step 5: Check it in Realtime

Where: Google Analytics > Reports > Realtime

  1. Open your store in a private window and click through a product and the cart.
  2. In GA4 open Reports > Realtime. You should see yourself as a user and events such as page_view, view_item and add_to_cart.
  3. Place a test order (for example with a discount code or a manual payment method), then refund or cancel it.
GA4 Realtime report with page_view, view_item, add_to_cart and purchase events listed and purchase highlighted
Step 5: In Realtime, look for one purchase event per test order, not two.
  • In GA4 Admin > Product links > Search Console links, link the property you created in the Search Console for Shopify tutorial.
  • Under Admin > Events, make sure purchase is marked as a key event.
  • Set data retention to the longest option under Admin > Data collection and modification > Data retention.

Troubleshooting

  • Purchases counted twice: an old gtag snippet or a second pixel is still sending. Keep one source only.
  • No purchase events: they can take time to appear outside Realtime. Also check the customer privacy settings: in regions where consent is required, visitors who decline are not tracked.
  • Revenue in the wrong currency: check the GA4 property currency in Admin > Property details.
  • Can't see the property in the app: the Google account you connected does not have Editor access on that GA4 property.

FAQs

Does Shopify have Google Analytics built in?

Not directly. The free Google & YouTube app is the supported way to connect GA4; the old field for a tracking ID in preferences was for the retired Universal Analytics.

Will GA4 match my Shopify sales report exactly?

No. Ad blockers, declined cookie consent and refunds mean GA4 usually shows fewer orders than Shopify. Use Shopify for sales totals and GA4 for where visitors came from.

Can I use Google Tag Manager on Shopify instead?

Yes, through a custom pixel in Customer events, but it takes more setup. For most stores the Google & YouTube app is enough.

Stuck on a step?

Tell me where you got stuck and I'll reply with a plan and a fixed quote, usually within 24 hours.

Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now