Back to Blog
guide 11 min read

GA4 Shopify Setup: Install Google Analytics 4 and Track Ecommerce

How to set up GA4 on Shopify with the Google & YouTube app or a custom pixel. Covers ecommerce events, testing in DebugView and what depends on your plan.

Kevin Wilson December 3, 2026

To set up GA4 on Shopify, you create a GA4 property and a web data stream, install the Google & YouTube sales channel on your store, and connect the two with your Measurement ID. Then you test that the ecommerce events arrive. Most stores can finish the first part in under an hour. The testing part is where most setups go wrong, so I spend more space on it below.

Shopify has changed how tracking works several times. The Google & YouTube app, customer events and the custom pixel sandbox all behave differently from what older tutorials show. I describe only what Shopify’s own documentation confirms. Where a detail depends on your Shopify plan or on the version of an app, I say so, and you should check it in your admin.

What you need before you start

Gather these items first. Each one blocks a later step if it is missing.

  • A Google account that you will keep long term. Use a shared company address, not one person’s inbox.
  • Admin access to your Shopify store. Staff accounts without app permissions cannot install a sales channel.
  • An online store that is open to visitors. Shopify’s help page says Google Analytics cannot track events until you turn off private mode (the password page) on your online store.
  • A decision on consent. If you sell to visitors in the EU, the UK or other regions with consent rules, set up your cookie banner and Shopify’s customer privacy settings before you test. Otherwise your test data may be missing for the wrong reason.

If you still have an old Universal Analytics property, leave it alone. Universal Analytics no longer collects data, and the GA4 property is a new, separate one.

Step 1: Create the GA4 property and a web data stream

  1. Sign in to Google Analytics and open Admin.
  2. Create a new account for your business, or pick the account you already have.
  3. Create a GA4 property. Set the time zone and currency to match how you report revenue. A wrong currency here makes revenue look fine until someone compares it to your Shopify reports.
  4. Add a web data stream. Enter your store’s primary domain and a name for the stream.
  5. Copy the Measurement ID. It starts with G-. Shopify’s help page calls it the Tag ID.

Check the data retention setting while you are in Admin. The default for event data is 2 months. Choose 14 months unless a privacy policy requires less.

Step 2: Install the Google & YouTube sales channel

Shopify says to install the Google & YouTube sales channel to add the Google tag to your store. This is the native integration.

  1. Install the Google & YouTube sales channel from the Shopify App Store.
  2. Follow Google’s help article “Shopify: Set up your Google tag” to add the Google tag. Shopify’s page points to it. Use the Tag ID (your Measurement ID) from step 1 when it asks for one.
  3. Check that the tag in your store matches the data stream you created in step 1.

You do not need to connect Google Merchant Center to get the GA4 tag working. Shopify says so on its setup page. If you run Google Shopping or Google Ads, you may want the connection for other reasons.

I do not describe the app’s screens or button labels. They change from release to release, and Shopify’s page does not describe them. Google’s article is the source I would trust for the current layout.

Step 3: Check which ecommerce events arrive

Shopify’s help page says that after setup, certain ecommerce events are tracked automatically, and it refers you to Google’s documentation on automatically collected events. It does not list them on its own page. I will not guess at the list either, because it can vary with the app version and your plan.

A normal Shopify purchase journey maps to these GA4 ecommerce events:

Shopper actionGA4 event
Views a collection or search resultsview_item_list
Opens a product pageview_item
Adds a product to the cartadd_to_cart
Starts checkoutbegin_checkout
Enters shipping detailsadd_shipping_info
Enters payment detailsadd_payment_info
Completes an orderpurchase

Test each one yourself. Do not assume the app sends all seven. A store with a customized theme or a custom checkout can send fewer.

How to test your GA4 Shopify setup

Testing takes about 20 minutes and saves weeks of bad data. Do it in this order.

  1. Open your store in a browser window that has no ad blocker.
  2. In GA4, open Admin, then DebugView. Turn on debug mode with the Google Tag Assistant extension.
  3. Walk the purchase journey from a collection page to the thank-you page. Use a test order if your payment setup allows one, or a real low-value order that you refund afterward.
  4. Watch DebugView. Each step should produce one event. Click the purchase event and check four parameters: transaction_id, value, currency and items.
  5. In the Realtime report, confirm the session appears with the right country and page.
  6. Wait a day. Then compare GA4 purchases and revenue against Shopify’s own order report for the same day.

The last step matters most. GA4 and Shopify will not match exactly. Consent choices, ad blockers and browser privacy settings all remove some sessions from GA4. A gap of a few percent is normal for many stores. A gap of 30 percent is a bug. I will not give you a magic threshold, because it depends on your traffic and your consent rate. Track the gap over several weeks and investigate any sudden change.

Then mark purchase as a key event in your GA4 property. Google now calls the events that measure important business actions “key events”, so older guides use the old term “conversions”.

Option 2: Use Google Tag Manager with a Shopify custom pixel

The Google & YouTube app is the right choice for many stores. Some teams need Google Tag Manager (GTM) because they send data to several platforms from one container. On Shopify, you can do that with a custom pixel.

Shopify’s documentation describes custom pixels as a way to collect customer events on more pages of your online store, including checkout and post-purchase pages, without changing your theme code. A few points from that page decide whether this option fits you:

  • Custom pixels load in a lax sandbox. Shopify says not all pixel functionality works in the sandbox, so you may need to check with each third-party provider.
  • Shopify calls custom pixels an advanced feature that needs JavaScript knowledge.
  • Shopify says adding and using custom pixels is unsupported by Shopify. It also says that compliance with laws, consents, code security, troubleshooting and updates are your responsibility.
  • Shopify has a separate tutorial on creating a Google Tag Manager custom pixel. Read it before you start.

You manage pixels in the Customer events section of your Shopify admin. Shopify publishes a list of standard customer events that a pixel can subscribe to. They include page_viewed, product_viewed, collection_viewed, search_submitted, product_added_to_cart, cart_viewed, checkout_started, payment_info_submitted and checkout_completed. In a custom pixel you subscribe to these events and push each one into GTM’s data layer in the GA4 ecommerce format. Then GTM tags send them to GA4. Shopify says web pixels run only when the visitor has given the permissions set in the pixel configuration. In regions that require consent, new pixels need Marketing and Analytics permission by default, so your test visits need consent too.

This takes more work than the app, and it has a cost I want you to understand. Because the pixel runs in a sandbox, a GTM container loaded there cannot read the page the way a container on a normal site does. Tags that depend on page elements, such as click triggers based on CSS selectors, may not work. Build your triggers on the data layer events you push, not on the page itself.

My rule is simple. Use the Google & YouTube app if GA4 and Google Ads are your only destinations. Use a custom pixel with GTM if you need more than that, and if you have someone who can maintain it.

Option 3: Other apps and theme code

Other routes exist. Shopify’s App Store lists third-party GA4 apps. Some of them add server-side delivery to recover sales that browsers drop. Older guides also tell you to paste a Google tag into the theme.liquid file of your online store. Be careful with that route. A theme edit does not reach every page in every checkout setup, and it can double-count if the Google & YouTube app is also installed.

Which checkout pages you can edit depends on your Shopify plan and on how your checkout is configured. Shopify has moved its checkout customization options over the last few years. I cannot tell you which pages your plan allows, so check the current Shopify help page for your plan before you plan work on checkout.

I do not review specific third-party apps here. If you pick one, read its current listing page, check when it was last updated and test it with the same DebugView steps as above.

The mistakes I see most often

Every one of these produces numbers that look plausible, which is why nobody catches them.

  • Two tags sending the same events. The Google & YouTube app is installed, and someone also pasted a tag into the theme or loaded GTM. Purchases arrive twice. Search DebugView for two purchase events with the same transaction_id.
  • Wrong or missing currency. The purchase event has value but no currency, or the property currency does not match the store.
  • Referral traffic from the payment provider. Shoppers who pay through an outside payment page can return as a referral from that page. Add it to the unwanted referrals list in the data stream settings.
  • Private mode left on. Shopify says tracking does not work until you remove the store password.
  • Consent banner blocks everything. A banner that never records consent means GA4 sees a fraction of your traffic.
  • Checkout on another domain. If a step in your journey happens on a different domain, check the cross-domain settings in your GA4 data stream. Whether this applies to you depends on your checkout setup.

My GA4 audit checklist covers these and the rest of the property settings, with where to look and what good looks like.

Which option to pick

Your situationWhat I would do
New store, GA4 and Google Ads onlyInstall the Google & YouTube sales channel
Several ad platforms and a team that knows GTMCustom pixel with a GTM container
Need to recover sales lost to browsers and ad blockersConsider a server-side setup. See server-side vs client-side tagging
Existing store with numbers nobody trustsAudit first, then change the setup

When to get help

The setup itself is not hard. Keeping the data right is the hard part. Themes change, apps update, someone adds a second tag, and purchase reporting drifts. If your store has several page types, such as collections, product pages, bundles and subscription pages, you also need each one to send the right items array.

Most stores already have GA4 and do not trust it. If that is you, start with the GA4 audit. It costs $2,500 per site, checks your purchase data against your orders and finds what is broken before you pay to rebuild anything.

If the store has no usable tracking at all, the tracking implementation service builds it at a fixed price. It lists at $3,000 as a base plus $750 for each page type. I write the tracking plan, build the events, test them against your orders and hand you documentation.

Tags:
ga4 shopify ga4 shopify setup install ga4 on shopify set up ga4 on shopify shopify google analytics 4 setup ga4 ecommerce tracking shopify customer events google tag manager

Want me to do this for you?

Agencies get white-label work at partner prices. In-house teams can get a fixed list price in two minutes.