1. Home
  2. Blog
  3. How to Add Google Analytics 4 to Shopify
Guide · Shopify Technical SEO

How to Add Google Analytics 4 to Shopify

Google Analytics 4 is free, and Shopify's official setup takes about 15 minutes: create a GA4 property, install the Google & YouTube app, and connect the two. The setup is quick; the part most stores get wrong is leaving an old tag in place, which double counts every purchase.

Shopify tells you what you sold. Google Analytics 4 tells you how people found you, what they looked at before buying, and where they dropped off. Without it, you are guessing at every marketing decision: which channel brings buyers, which product pages convert, and which traffic is worth paying for.

The good news is that adding GA4 to Shopify is a 15 minute job with no code. Shopify's official method uses the free Google and YouTube app, and Google calls that method strongly preferred. This guide walks through it step by step, then covers the manual method, the mistakes that double count your sales, and what to check after the setup.

The short answer

Create a GA4 property with a web data stream at analytics.google.com, install the free Google and YouTube app from the Shopify App Store, open the app, find the Google Analytics 4 section, select your property, and click Connect. Then remove your store password and check the Realtime report in GA4 to confirm data is arriving.

That is the whole setup. Everything after this section is detail: the exact clicks, the checks that prove it works, and the old tags you must remove so your numbers stay honest. Shopify's own guide to GA4 ecommerce setup covers the same steps.

What you need before you start

You need three things. First, a Google account with Editor access to the GA4 property you want to use, or the ability to create a new one. Second, a Shopify store on a paid plan with the store password removed or ready to be removed, because GA4 cannot track a password protected store. Third, about 15 minutes and a list of any old Google tags already on the store, so you can remove them later.

If an old Universal Analytics tag is still in your theme or your settings, find it before you connect GA4. Universal Analytics stopped processing data in July 2023, so that old tag is dead weight, and a leftover gtag in your theme is the most common cause of double counted purchases.

Step 1: Create a GA4 property and web data stream

Go to analytics.google.com and sign in with the Google account that will own the property. If you already have a GA4 property for the store, skip to Step 2 and note its Measurement ID, which starts with G- and looks like G-XXXXXXXXXX. If not, create one: Admin, then Create, then Property, and follow the prompts to name the property, set the time zone and currency, and answer the business questions.

Then create a web data stream. In the property, go to Admin, then Data collection and modification, then Data streams, choose Web, and enter your store URL and a stream name. GA4 gives you a Measurement ID starting with G-. Copy it somewhere safe: you will need it if you ever use the manual method.

Keep one property per store. A property collects data for one website by default, and mixing two stores into one property makes every report harder to read. If you run a second store, create a second property.

Step 2: Install the Google & YouTube app

In your Shopify admin, go to Apps, then search the Shopify App Store for Google and YouTube, and install it. The app is free and made by Google. It is the same app you would use for Google Merchant Center and Google Ads, but you do not need to connect Merchant Center to use it for Analytics.

During installation, connect the Google account that owns your GA4 property. Use the same account you used in Step 1: if the app is connected to a different Google account, your property will not appear in the list and you will waste time wondering why.

Step 3: Connect your GA4 property

Open the Google and YouTube app and find the Google Analytics 4 section on the Overview page. Click Get started, select your GA4 property from the list, click Connect, then Confirm. That is the connection: the app now sends your store's ecommerce events to GA4 automatically.

Do not add a second GA4 tag anywhere else after this step. The app is your one connection. Adding the same tag in your theme code or in Google Tag Manager on top of the app sends every event twice, and your purchase count will be double the real number.

Step 4: Remove the store password

GA4 cannot track events while your online store is in private mode. If your store still has a password page up, go to Online Store, then Preferences, and remove the store password. This is the step people forget, and it is the most common reason a fresh GA4 setup shows zero visitors.

If the store is not ready for the public yet, finish the setup, verify it on a preview, and remove the password on launch day. Just know that no data will be collected until the password is gone.

Step 5: Verify the setup is working

Open your store in a browser and click around: view a product, add it to the cart, and start checkout. Then open GA4, go to Reports, then Realtime, and look for your visit. If you see yourself in the Realtime report, the tag is firing and data is flowing.

For a deeper check, use Google Tag Assistant to confirm the tag loads on every page, and DebugView in GA4 to watch each event arrive as you click. Place one test order and confirm a single purchase event appears with the right value: one purchase, not two. Most other reports take 24 to 48 hours to fill, so do not worry if the standard reports look empty on day one.

Also confirm the purchase value looks right. GA4 records the purchase value as the subtotal minus discounts, with shipping and taxes excluded, so the revenue in GA4 will sit below the sales total in your Shopify admin. That gap is normal. The numbers to compare are the order counts, not the revenue totals.

The manual method: adding a tag ID by hand

If you cannot connect the property directly, for example because you do not have the right access to the GA4 property, or you need data in two properties, the app lets you add a Google tag by hand. Open the app, go to Settings, find the Google tags section, and paste your Measurement ID starting with G-.

Google still calls the direct connection strongly preferred, and for good reason: the manual method only adds the tag, while the connection also wires up the full ecommerce event flow. Use the manual method only when the direct connection is not possible.

A third option is a custom pixel: you can add GA4 through Google Tag Manager or a gtag snippet in Settings, then Customer events. This is the route when the Google and YouTube app is not offered for your country or currency, or when a busy Tag Manager container already runs your marketing tags. It is also the route that causes the most duplicate tracking, because the custom pixel and the app can both fire the same events. Pick one route and stick to it.

What GA4 tracks on Shopify automatically

Once the app is connected, Shopify sends the key ecommerce events to GA4 with no extra setup: page views, product views, add to cart, begin checkout, add payment info, and purchase. It also sends the product, price, and order details with each event, so you can build reports on which products sell, which collections convert, and which traffic sources bring buyers.

Purchase is a key event by default in GA4. You can mark other events as key events in Admin, then Data display, then Events, by clicking the star next to the event: add to cart and begin checkout are the two most useful ones for a store, because they show you where the funnel leaks.

GA4 also collects enhanced measurement automatically: scrolls, outbound clicks, site search, and file downloads. You can turn individual enhanced measurement events on or off in the data stream settings if one of them pollutes your reports.

Common mistakes that break GA4 on Shopify

The first mistake is running two tags. An old gtag left in theme.liquid, a GA4 tag in Google Tag Manager, and the Google and YouTube app all firing at once will double or triple count every purchase. Search your theme code, your checkout settings, and Settings then Customer events for old tags, and remove every tag except the one connection you chose.

The second mistake is leaving the store password on. GA4 cannot track a password protected store, so a setup that looks complete will show no data at all until the password comes off.

The third mistake is connecting the wrong property. If your Google account has access to several properties, it is easy to pick the wrong one, especially if two properties have similar names. Check the Measurement ID in the app against the one in GA4 before you call the job done.

The fourth mistake is judging the setup by the standard reports on day one. GA4 takes 24 to 48 hours to process data into most reports. Realtime is the only report that shows data immediately, so verify there and wait a day for the rest.

The fifth mistake is expecting GA4 revenue to match Shopify sales exactly. Ad blockers, cookie consent, and the subtotal-only purchase value all make GA4 revenue lower than Shopify revenue. If the order counts match, the setup is fine.

What GA4 will not show you

GA4 does not replace the reports already inside your Shopify admin: it adds Google's view of the same traffic. Your admin is still the source of truth for orders, refunds, and revenue. GA4 is the source of truth for where visitors came from and what they did before buying.

GA4 also will not tell you why a visitor left. It shows the page they left on, not the reason. For the reason, you need the page itself: slow load times, unclear pricing, or a checkout that asks for too much. Our guide to speeding up a Shopify store covers the most common fix first.

And GA4 will not fix your SEO. It measures it. If the data shows that organic search brings visitors who never buy, the fix is on the pages they land on, not in the analytics settings. That is where an SEO audit starts: finding the pages that rank but do not convert.

How much does it cost to add GA4 to Shopify?

Nothing. GA4 is free, and the Google and YouTube app is free. The only cost is your time: about 15 minutes for the setup and a test order to verify it.

If you would rather have someone else do it, the work is usually bundled into a technical SEO engagement. Our technical SEO sprints start from $350, and an SEO audit starts from $200 one time. Either one includes checking that GA4 is set up correctly and that your purchase tracking is not double counting, because an audit is only useful if the data behind it is honest.

Be wary of anyone charging a large fee for the GA4 setup alone. The connection itself is a few clicks. What is worth paying for is the verification and the cleanup: finding the old tags, fixing the duplicates, and confirming the purchase events match your real orders.

Frequently asked questions

Is Google Analytics 4 free for Shopify stores?

Yes. GA4 is free for any store, and the Google and YouTube app that connects it to Shopify is also free. You pay only if you hire someone to set it up or to audit the tracking.

Do I need Google Tag Manager to add GA4 to Shopify?

No. The Google and YouTube app is the recommended method and needs no Tag Manager. Use Tag Manager only if you already run a container with other marketing tags, and in that case leave the app's Google Analytics section unconnected so you do not run two tags.

Why is GA4 showing no data after I connected it?

Check three things in order: the store password is removed, the right property is connected, and you are looking at the Realtime report rather than a standard report. Standard reports take 24 to 48 hours to fill. If Realtime is empty too, use Tag Assistant to check whether the tag loads on your store.

Why does GA4 show fewer sales than Shopify?

GA4 revenue excludes shipping and taxes, and counts only the subtotal minus discounts, so it will always sit below your Shopify sales total. Ad blockers and cookie consent remove some visits entirely. Compare order counts, not revenue, to check that tracking is working.

Can I add GA4 to Shopify without the Google and YouTube app?

Yes, with a manual tag ID in the app's Settings or a custom pixel through Google Tag Manager or a gtag snippet. The direct connection is still the strongly preferred method, because it wires up the ecommerce events automatically.

Will GA4 track my checkout and purchase events automatically?

Yes, when it is connected through the Google and YouTube app. The app sends page views, product views, add to cart, begin checkout, add payment info, and purchase events to GA4 with no extra code. If you use the manual method or a custom pixel, you may need to set up those events yourself.

Saqib Ali

Saqib Ali runs Globe Skillz, a Shopify SEO studio with development built in. Since 2019 he has worked on 180+ projects for merchants in 42 countries. More about Saqib →

Want to know what’s holding your store back?

Send me your store URL. I’ll record a short review of the biggest SEO and technical issues I can find — free, and yours to keep whether we work together or not.