Skip to content

Guide · Google Analytics 4

How to set up GA4 ecommerce tracking on Shopify

Connect your GA4 property through Shopify's Google & YouTube app, which sends the main ecommerce events for you. Use a custom pixel under Settings, Customer events only when you need more control. Then place a test order, confirm the purchase event in GA4's Realtime or DebugView report, and remove any older tags so nothing counts twice.

Which way should you install GA4 on Shopify?

For most stores, the Google & YouTube app. Shopify's own help pages point to it, and Google's setup article calls connecting your GA4 property through the app the strongly preferred option. It runs through Shopify's pixel system, so it reaches the checkout and follows your store's customer privacy settings.

A custom pixel is for stores that need events or parameters the app doesn't send, or that run Google Tag Manager. Shopify describes custom pixels as an advanced feature that needs JavaScript knowledge, and you are responsible for the code, consent and updates. Pasting gtag code into theme.liquid is the old way: it can't see the checkout and it is the most common source of duplicate purchases.

Ways to install GA4 on Shopify
MethodWhere you set it upGood forWatch out for
Google & YouTube appThe app's Overview page, connect your GA4 propertyMost stores; no codeSends only the events the app supports
Custom pixelSettings, Customer events, Add pixelExtra events, Tag Manager, custom parametersYou maintain the code and its consent settings
Code in the themetheme.liquidNothing new; it is legacyMisses checkout and doubles up with the app

Which ecommerce events should GA4 receive from Shopify?

Shopify says certain ecommerce events are tracked automatically once GA4 is connected, such as viewing a product, adding to cart and completing a purchase. Google's setup article also lists collection views, cart views, removals from the cart and shipping details at checkout. The exact list changes over time, so treat your own DebugView as the final word on what your store sends.

  • page_view: every page load. If this is missing, nothing else will work.
  • view_item: a product page view. Feeds GA4's item reports.
  • add_to_cart: an item added to the cart.
  • begin_checkout: the shopper reaches checkout.
  • purchase: the completed order, with a transaction ID, value, currency and items. This is the one that matters most.
  • Also sent by the app, per Google's article: view_item_list, view_cart, remove_from_cart and add_shipping_info.

How do you check that purchase events reach GA4?

Place an order and watch for it. GA4's Realtime report (Reports, Realtime) shows events from the last 30 minutes, so a purchase you just made should appear in its event list. For a closer look, DebugView (Admin, then Data display, DebugView) shows each event with its parameters, but only for traffic in debug mode, which Google Tag Assistant turns on for your own browser.

In DebugView, open the purchase event and check that transaction_id, value and currency are filled and that the items are listed. A purchase with no value or the wrong currency is the usual reason GA4 revenue looks off later. Remember that a test order sent with a live tag is counted in GA4 like any other purchase.

Shopify also notes that GA4 can't track events while your online store is password protected, so a store that is still in private mode will show nothing.

How do you avoid duplicate GA4 tags on Shopify?

Send each event to your GA4 measurement ID (it starts with G-) from one place only. If the app and a custom pixel both send purchase to the same property, every order counts twice.

  • Remove old gtag or Tag Manager code from theme.liquid. Shopify's custom pixel guide also says to clear checkout.liquid (Shopify Plus only) and the Additional scripts box in checkout settings before adding a pixel.
  • Check the apps you've installed. Some review, upsell and analytics apps add their own Google tag.
  • Look in Settings, Customer events for app pixels and custom pixels that send to the same G- ID.
  • Once data flows, build a GA4 exploration with the Transaction ID dimension. An ID that appears more than once means a duplicate.

Shopify passes each shopper's consent choice to the pixels that run on your store. You set this up under Settings, Customer privacy, where you can turn on Shopify's cookie banner. If you use a third-party banner, connect it to Shopify's customer privacy settings so the choice reaches Google.

For a custom pixel, the Customer privacy section has a Permission setting: Required means the pixel waits for permission for the purposes you pick, such as analytics or marketing, and Not required means it always runs. Shoppers who decline analytics send GA4 little or nothing, which is one reason GA4 will read lower than Shopify. Our guide on Shopify and GA4 revenue covers that gap.

How do you set up GA4 ecommerce tracking on Shopify by hand?

Allow an hour, including a test order. You need editor access in Google Analytics and owner or staff access in Shopify.

  1. In Google Analytics, create a GA4 property if you don't have one, add a web data stream for your store's domain and note the Tag ID (G-...).
  2. In Shopify, install the Google & YouTube app and sign in with the Google account that has access to the property. You don't need to connect Merchant Center for analytics.
  3. On the app's Overview page, find the section for setting up Google Analytics 4 only, choose Get started, pick your property and confirm.
  4. Remove any older GA4 code from theme.liquid, checkout.liquid and checkout Additional scripts, and check Settings, Customer events for other pixels sending to the same ID.
  5. Set up consent under Settings, Customer privacy, and make sure your store isn't password protected.
  6. Open Google Tag Assistant for your store, browse a product, add it to the cart and place a test order. Watch page_view, view_item, add_to_cart, begin_checkout and purchase arrive in DebugView.
  7. A day later, compare GA4 transactions with your Shopify online store orders for that day, and recheck after any theme or app change.

How does Datae check your GA4 ecommerce tracking?

Datae doesn't install tags; the steps above are yours to do. Once GA4 is collecting, connect it to Datae and ask whether tracking looks right. Datae lists the events your GA4 property received with their counts, pulls the ecommerce funnel (sessions, add-to-carts, checkouts and purchases) and the purchase totals, and puts GA4 transactions next to your Shopify orders for the same dates.

That shows the common faults quickly. An ecommerce event with no count means it isn't firing. Purchases far below your Shopify online orders point to a missing purchase event or consent. More GA4 transactions than Shopify orders point to a duplicate tag. The checkout funnel skill then reads the same funnel for drop-off once you trust the data.

  1. Install Datae from the Shopify App Store. It installs read-only.
  2. In Settings, choose Connect Google and pick your GA4 property.
  3. Ask one of the questions below, or run the checkout funnel skill with / in the chat.
  4. Schedule the comparison weekly so a tag that breaks after a theme or app change shows up within days.

What can you ask Datae?

Install Datae, open the chat and paste one in. The answer comes from your own store's data.

  • “Which ecommerce events did my GA4 property receive in the last 7 days, and is anything missing?”
  • “Compare GA4 transactions with my Shopify online store orders for each of the last 14 days.”
  • “Are my GA4 add-to-cart, checkout and purchase counts believable next to my Shopify orders?”

Common questions

Do I need Google Tag Manager for GA4 on Shopify?

No. The Google & YouTube app sends the main ecommerce events without Tag Manager. Tag Manager is useful when you need custom events or tags for several tools, and on Shopify it runs inside a custom pixel.

Why doesn't my test purchase show in DebugView?

DebugView only shows traffic in debug mode, so open your store through Google Tag Assistant first. Also check that the store isn't password protected and that your cookie banner choice allowed analytics.

Which connectors are included?

All of them, on every plan: Shopify, Google Analytics 4, Search Console, Google Ads, Merchant Center, Klaviyo, Meta Ads, TikTok Ads and Pinterest Ads.

Is my data secure?

Connections use OAuth and tokens are encrypted at rest. Datae fetches data on demand to answer each question rather than syncing your store. Chat transcripts, including the data tools returned, are kept so you can revisit past analyses; you can delete any chat at any time, and uninstalling removes all of your shop's data. Datae implements Shopify's mandatory privacy webhooks. See our Privacy Policy for the full picture.

Ask your store its first question

Free plan, no credit card. Datae installs read-only.

Install free on Shopify

More guides

Install free on Shopify