ULTRO NOTES Published Updated

Shopify Google Analytics Setup: Connect GA4 and Check It Works

The three ways to connect GA4 to Shopify, step-by-step setup with the Google & YouTube app, the events it sends, what to check afterwards, why your numbers won't match Shopify's, and how to fix common problems.

In shortThe standard way to set up Google Analytics on Shopify is to connect your GA4 property through the Google & YouTube app. Once it's connected, ecommerce events from page views to purchases are sent to GA4 with no extra setup. If you need GTM, add it as a custom pixel under Settings > Customer events. Tags pasted into your theme code don't run on checkout or the thank you page, so they can't track purchases. Whichever method you use, some purchases can't be tracked by a tag at all, such as buyers who never return from an off-site payment gateway or who use ad blockers, so after setup, match orders against GA4 transaction IDs to see how many are missing.

Most people starting with Google Analytics 4 on Shopify get stuck on which way to connect it. The method Shopify points you to is its Google & YouTube app. But some merchants want to build things out in Google Tag Manager, and others pasted a tag into their theme years ago, so we often see stores with GA4 tags in several places at once.

This guide walks through the three ways to connect Shopify and GA4, how to connect with the Google & YouTube app, which events it sends automatically, and what to check once it’s connected. The second half covers why your numbers won’t match Shopify’s, what to watch out for with GTM, and common problems. Steps and specs follow Shopify’s and Google’s help documentation as of October 2026.

Three ways to connect Shopify and Google Analytics 4

There are three ways to add GA4 to Shopify: the Google & YouTube app, a custom pixel (GTM or similar), or pasting the tag into your theme code. Most stores should use the Google & YouTube app. Shopify recommends its built-in integration because it has the logic for recording ecommerce data built in, and warns that adding Google Analytics through GTM as well can result in duplicate tracking.

Google & YouTube appCustom pixel (GTM, etc.)Pasted into theme code
How to add itSelect your GA4 property in the appAdd code under Settings > Customer events in the Shopify adminPaste the Google tag into theme.liquid
Ecommerce eventsSent automaticallyYou build them (from Shopify’s standard events)You build them
Checkout and thank you pageRunsRunsDoesn’t run
PurchasesTrackedTrackedNot tracked
Consent bannerFollows Shopify’s settingsFollows the pixel’s Permission setting; you write Consent Mode yourselfNot connected automatically (you’d have to call the Customer Privacy API yourself)
Best forAlmost every storeStores that want to manage custom events and multiple vendors’ tags themselvesNot recommended

If you’re not sure, choose the Google & YouTube app and go on to “Before you connect.” Notes on GTM are in “Adding GA4 with GTM or your theme” further down.

Before you connect

Before connecting GA4 in the Google & YouTube app, have a GA4 property with a web data stream and a Google account with Editor access or higher on that property, and turn off password protection on your store. It also helps to take stock of the tags already installed, so you’re not chasing double counting later.

What you needDetails
A GA4 property and web data streamCreate them in GA4 if you don’t have them. The web stream URL is your store’s domain
Google account accessEditor or higher on the property you connect. If you’ll connect Google Ads with the same account, admin access there helps too
Password protection offShopify’s help says Google Analytics can’t track events until you deactivate private mode for your online store
An inventory of existing tagsLook for GA4 tags in theme.liquid, checkout Additional scripts, custom pixels and other tracking apps

A property is the container for one site’s data, and a web data stream is the entry point that receives data from that site. If you don’t use GA4 yet, create them in this order, following Google’s help:

  1. In GA4, open Admin, click Create, and choose Property. If this is your first time, start with Start measuring to create an account.
  2. Enter a property name and choose the reporting time zone and currency. Using the same time zone as your Shopify store makes daily numbers easier to compare.
  3. Under Data streams, add a Web stream, enter your store URL and a stream name, and click Create & continue.

How to connect GA4 with the Google & YouTube app

To connect GA4 with the Google & YouTube app, install the app, then pick your property in the Google Analytics section of the app’s Overview page and connect it. The button and section names below follow Google’s help.

  1. In the Shopify admin, search for “Google & YouTube,” and click Install on its Shopify App Store page. Review the permissions the app asks for and click Install again.
  2. Click Connect Google Account and choose a Google account with Editor access or higher on your GA4 property.
  3. On the app’s Overview page, find the “Just want to set up Google Analytics 4” section and click Get started.
  4. In the “Your Google Account” section, the GA4 properties that account can access are listed. Select the one you want, click Connect, then click Confirm.
  5. The Google tag (gtag.js) is now on your store. Open GA4’s Realtime report and check that your own visit appears.

You can also check the connection on the app’s Overview page, where Google Analytics shows as connected.

Connected services on the Google & YouTube app Overview page. On the Google Analytics tab, the Google Analytics card shows Active and a View performance in Google Analytics button. Merchant Center figures are hidden
① The Google Analytics card shows Active (Screen as of October 2026. Click the image to enlarge.)

A Google tag is the code that sends data to GA4, and it identifies the destination property by a measurement ID that starts with “G-.” When you connect through the app, you never have to paste the measurement ID yourself.

You don’t need to connect Google Merchant Center just to use GA4, and you can skip connecting a Google Ads account and set up GA4 alone.

If you don’t have access, or want to send to more than one property

If you don’t have access to the property, or you want to send data to two or more properties, add the Google tag manually. Google’s help treats this as an alternative and strongly prefers connecting the property.

  1. Open the Google & YouTube app’s Settings page.
  2. In the Google tags section, click Manage.
  3. Add the Google tag for the GA4 property and click Save.
  4. Click Complete setup.

Events the Google & YouTube app sends to GA4

When you connect GA4 through the Google & YouTube app, recommended ecommerce events are sent to GA4 automatically, mapped from Shopify’s standard events. Google’s developer documentation, “Shopify event parameters,” lists these:

GA4 eventSent whenShopify event
page_viewA page is viewedpage_viewed
view_item_listA collection page is viewed—
view_itemA product page is viewedproduct_viewed
searchSomeone searches the storesearch_submitted
add_to_cartA product is added to the cartproduct_added_to_cart
remove_from_cartA product is removed from the cart—
view_cartThe cart page is viewed—
begin_checkoutCheckout startscheckout_started
add_shipping_infoShipping or address details are entered at checkout—
add_payment_infoPayment information is submittedpayment_info_submitted
purchaseA purchase is completedcheckout_completed

A dash means the documentation doesn’t name the source Shopify event. Standard events such as session_start, first_visit and user_engagement are sent as well. Google’s help lists view_item_list, remove_from_cart, view_cart and add_shipping_info as newly collected events. add_shipping_info is only available in checkouts where Checkout Extensibility is enabled for customizations.

You usually don’t need to touch any of this. If you want to exclude specific events from reports, each event carries a shopify_event_name parameter you can filter on in GA4. To stop all GA4 data from the app, disconnect the Google Analytics integration in the app’s settings; purchase events stop too.

For how GA4 events are structured in general, see GA4 events explained.

Purchase value and transaction_id

Since April 24, 2025, the value the Google & YouTube app sends with purchase and begin_checkout (the basis for purchase revenue) accounts for both item-level and order-level discounts and excludes shipping and tax. If an event has no currency, GA4 treats it as USD. A US store won’t notice, but if you sell in another currency, check in DebugView that currency matches your store currency.

Purchases also carry a transaction_id that identifies the order. Google’s documentation doesn’t say which Shopify value goes into it, though. Shopify has two kinds of order identifiers, the order number (like #1001) and the long numeric order ID, and which one a tag sends depends on the route. After connecting, list transaction IDs in a GA4 exploration (the dimension is called Transaction ID) and check which one your store sends. You’ll need this to match orders or investigate double counting.

Ecommerce events only count as results for ads and channels once you mark purchase as a key event in GA4.

What to check after connecting GA4

After connecting Shopify and GA4, check that data arrives, that each purchase is recorded once, and that settings are in place to keep your data accurate. The baseline for any tracking setup is that tags fire on every page and each action is recorded exactly once. On Shopify, that comes down to seven checks (our own list).

PriorityCheckWhereWhat to look for
Same dayData is arrivingGA4 RealtimeYour own visit shows up within seconds to minutes
Same dayTest purchaseGA4 DebugViewpurchase has transaction_id, value, currency and items
Same dayData retentionAdmin > Data collection and modification > Data retentionChange event data retention from 2 months to 14 months
Same dayEach purchase is counted onceGA4 ExploreTransaction ID doesn’t mix order numbers and order IDs, and no ID has 2 or more transactions
When you canInternal trafficConfigure tag settings in your web stream detailsRegister office IP addresses under Define internal traffic and exclude them with a data filter
When you canPayment gateway referralsList unwanted referrals in Configure tag settingsBuyers returning from an off-site payment page aren’t credited to the gateway
If you use Google AdsPurchase conversionsGoogle Ads conversion actionsTwo purchase conversion actions aren’t both set to Primary

Check Realtime and DebugView

To check the connection, open your store yourself and check that the visit appears in GA4’s Realtime report. Google’s help also points to the Realtime report for this.

To see what’s inside each event, use DebugView. Turn on debug mode with Google Tag Assistant, browse your store, then open DebugView from Admin > Data display. According to Google’s help, if you’ve implemented Consent Mode and the user hasn’t consented to analytics cookies, events don’t appear in DebugView. If your store shows a consent banner, accept it in your own browser before testing. How to connect Tag Assistant and read its screens is covered in How to use Google Tag Assistant.

To test purchases, buy an inexpensive product yourself and check that a purchase arrives in Realtime and DebugView. Afterwards, cancel and refund the order and note its order number so you can exclude it later. If you’ve activated a data filter that excludes internal IP addresses, purchases from that IP won’t show in reports, so make test purchases while the filter is still in Testing.

Check that each purchase is counted once

GA4 deduplicates purchases with the same transaction ID in web streams. So even if a purchase is sent twice, it usually collapses into one when the IDs match. Most double counting shows up instead as IDs in different formats side by side, such as #1001 and a long numeric order ID.

Diagram of the same purchase sent to GA4 from two routes, such as the Google & YouTube app and a tag in the theme or a custom pixel. If both send the order number (#1001 and #1001), GA4 treats them as the same transaction ID, deduplicates them, and usually counts one purchase. If an order number and a long numeric order ID are mixed, they're listed as two IDs and counted twice. To check, list Transaction ID in an exploration and look for a mix of order numbers and order IDs, and for any ID with 2 or more transactions
When a purchase is sent twice, the ID format decides whether it counts once or twice (As of October 2026. Created by ULTRO Inc. based on Google Analytics Help. Click the image to enlarge.)

In GA4, go to Explore and start a Blank exploration (leave the technique as Free form). Add Transaction ID as a dimension and Transactions as a metric. In the selection dialog, check each one and confirm with the button at the top right.

The Select dimensions screen in a GA4 exploration, with transaction typed in the search box. Transaction ID under the Ecommerce category is checked, and the Confirm button is at the top right
① Check Transaction ID ② Click Confirm (Screen as of October 2026. Click the image to enlarge.)

First sort by Transaction ID to see whether order numbers and order IDs are mixed. Then sort Transactions in descending order and look for any ID with 2 or more. How to investigate and fix it is covered in GA4 duplicate transactions.

Settings that keep your data accurate

If data retention stays at the default 2 months, you can’t compare with last year in explorations. Change event data retention to 14 months. Data that’s already been deleted doesn’t come back, so change it on the day you connect. Standard reports aren’t affected by this setting.

Internal visits and test purchases make your numbers look bigger than they are. Open Configure tag settings in your web stream details and expand the full Settings list to find Define internal traffic. Register your office IP addresses there and exclude them with a data filter, which removes matching data as it’s processed. Excluded data can’t be recovered, so start with the filter in Testing and switch it to Active once you’ve confirmed it behaves as expected.

If any payment method sends buyers to an off-site payment page (PayPal, for example), add that domain to List unwanted referrals in the same list. Otherwise purchases are credited as referrals from the payment provider, and your ads and search look like they’re producing less.

The Settings list of the Google tag in GA4, fully expanded. It includes Define internal traffic, List unwanted referrals, Adjust session timeout and other settings. List unwanted referrals and Adjust session timeout are highlighted
① List unwanted referrals ② Adjust session timeout (Screen as of October 2026. Click the image to enlarge.)

Why Shopify and GA4 numbers don’t match

Shopify and GA4 numbers don’t match because two things overlap: sales and sessions are defined differently, and some purchases can’t be tracked by a tag at all. In our view, the practical approach is to use Shopify for order and sales totals, and GA4 for traffic sources and on-site behavior.

Diagram of the two reasons Shopify and GA4 numbers don't match. Reason 1 is that sales and sessions are defined differently: purchase amount, sessions and the day boundary differ. Align amounts by matching the Shopify metric to GA4's definition (the app's value is after discounts and excludes shipping and tax), compare session trends rather than counts, and use the same time zone for dates. Reason 2 is purchases a tag can't track: buyers who don't return from an off-site gateway, ad blockers, checkouts inside AI or social apps, subscription renewals, and declined consent. Check by matching Shopify orders to GA4 transaction IDs by order number; GA4 comes up short by this amount. We use Shopify for order and sales totals and GA4 for traffic sources and on-site behavior
The two reasons Shopify and GA4 numbers don't match (As of October 2026. Created by ULTRO Inc. based on Shopify and Google help documentation. Click the image to enlarge.)

Different definitions

ItemGA4ShopifyHow to align
Purchase amountThe app’s value is after discounts, excluding shipping and taxEach sales metric treats shipping, tax and returns differentlyMatch the Shopify metric to GA4’s definition
SessionsCounted by GA4’s definitionShopify Analytics’ own measurement, updated September 21–23, 2026Compare trends instead of trying to match counts
Day boundaryThe property’s time zoneThe store’s time zoneUse the same time zone in both
Purchase countOnly purchases where the tag ranEvery orderMatch by order number

When comparing Shopify data across the September 2026 session update, Shopify’s help asks you to treat it as a measurement change for sessions, conversion rate and other session-based metrics.

Purchases a tag can’t track

GA4 records a purchase when the tag runs in the buyer’s browser. Even with the Google & YouTube app, purchases like these may never reach GA4:

Purchases likely to be missedWhy
Buyers who don’t return from an off-site payment gateway (PayPal, Klarna, etc.)After paying, they close the tab instead of returning to the thank you page
Ad blockers and browser tracking protectionThe tag is blocked from loading or sending
Checkouts completed inside AI assistants or social appsNo store page is ever opened
Subscription renewalsOrders are created automatically; the buyer never visits
Buyers who declined tracking in a consent bannerCorrectly left out, since they declined

In one client store connected through the Google & YouTube app, we matched Shopify orders against GA4 purchases one by one from August to mid-September 2026, and 21% of orders weren’t in GA4. How much was missing varied a lot by payment method. Even with the app set up correctly, purchases a tag can’t track remain. Orders placed inside AI assistants are covered in AI orders and GA4.

Start by checking how many are missing in your own store: export Shopify orders as CSV, export transaction IDs from a GA4 exploration, match them by order number, and pull out the orders missing from GA4. The full steps, including breaking them down by payment method, are in GA4 Not Tracking All Shopify Purchases?

To fill the gap, you can send orders to GA4 directly from your server, starting from the order data. Google’s mechanism for that is the Measurement Protocol. Server-side GTM, which resends browser events through your own server, differs in that it can’t recover purchases where no browser event ever happened.

We turned that approach into a Shopify app, GapFill. It’s our own product, so keep that in mind. It matches Shopify orders against GA4 purchases by transaction ID and recovers the missing GA4 purchase events server-side. It works alongside your existing tags, and the missing purchases report is free, so you can see how many orders and how much revenue are missing first.

Our Shopify appGapFill: Recover missing GA4 purchase events server-sideWorks alongside your existing tags. Free missing purchases report.See GapFill →

Adding GA4 with GTM or your theme

If you add GA4 with GTM, put it in a custom pixel under Settings > Customer events in the Shopify admin, not in your theme, and don’t connect GA4 in the Google & YouTube app. If you connect both, the same purchase is sent from two routes.

Additional scripts and checkout.liquid no longer work

You can no longer put a GA4 purchase tag in the “Additional scripts” field in Shopify’s checkout settings, or in checkout.liquid on Shopify Plus. Both used to be the usual places. According to Shopify’s help, Additional scripts became read-only on August 28, 2025, and the deadline for non-Plus stores to upgrade their Thank you and Order status pages was August 26, 2026. Tracking on the new pages is meant to run through app pixels or custom pixels.

If your store used to add its purchase tag the old way, it may not be sending purchases anymore. If GA4 purchases dropped suddenly in late August, suspect this first.

Using GTM in a custom pixel

Custom pixels load on the storefront, checkout, thank you page and order status page, so they can track purchases. They run in a sandbox, though, which comes with limits. The main ones from Shopify’s and Google’s help:

  • The URL detected inside the sandbox may be a sandbox version rather than the main window’s URL. Shopify recommends taking the URL from the page_viewed event, so turn off GA4’s automatic page views and resend them with page_location from page_viewed
  • Some GA4 features, such as automatically collected events and enhanced measurement (outbound link clicks, for example), may not work
  • Google lists Tag Assistant among the Google tag features that may not work with a custom pixel
  • Shopify doesn’t support adding and using custom pixels, and Google says running Google tags inside custom pixels isn’t a supported implementation, so neither company’s support can help you fix issues

How to write the code and what to watch out for are covered in Shopify custom pixels.

Prevent double-counted purchase conversions in Google Ads

If you’ve also connected Google Ads through the Google & YouTube app, check that Google Ads doesn’t have two purchase conversion actions that are both Primary. Google Ads Data Manager’s help says that when the app is set up for conversion measurement, purchase conversions from Shopify’s “Checkout completed” event are also sent to Google Ads server-to-server and deduplicated against the Google tag’s.

Purchases imported from GA4 may also be in Google Ads. If both the app’s purchase conversion action and the GA4-imported one are Primary, the same purchase is counted twice and Smart Bidding learns from inflated numbers. In your Google Ads conversion actions, make sure only one purchase action is Primary and set the other to Secondary.

Common problems and how to check them

Common problems connecting Shopify and GA4 fall into four groups: no data, purchase counts that don’t match, wrong traffic sources, and tracking blocked by a consent banner.

SymptomCommon causeHow to check or fix
No data in GA4 at allPassword protection (private mode) is on, or the wrong property is connectedRemove password protection. Check the connected property in the app’s settings
Your own visit doesn’t show in RealtimeAd blocker, declined consent, or excluded as internal trafficOpen the store in another browser and accept consent. Check your data filter state
More purchases than Shopify ordersPurchases sent from both the app and GTM (theme or custom pixel)Check the transaction ID format in an exploration. Send purchases from one route only
Far fewer purchases than Shopify ordersAn old-style purchase tag stopped working, or the tag doesn’t run on the thank you pageCheck how purchases are being sent. Match by order number
Lots of payment gateway or “(not set)” sourcesNo unwanted referrals listed, or redirects dropping UTMsSet up List unwanted referrals. Check ad landing URLs
Unfamiliar strings in page URLsSandbox URLs from a custom pixelSend page_location from page_viewed
Fewer visits from the EU and UK onlyVisitors declining in the consent bannerDeclined visitors are correctly left out. Check your banner settings

To check traffic sources, open Reports > Generate leads > Traffic acquisition in the left menu (or Life cycle > Acquisition > Traffic acquisition, depending on the property), and switch the dimension at the top left of the table to Session source / medium.

GA4 Traffic acquisition report with Session source / medium as the dimension. The rows include product_page / (not set) and, near the bottom, a row that is (not set) for both. Numbers are hidden
① A source with (not set) as the medium ② A row that is (not set) for both (Screen as of October 2026. Click the image to enlarge.)

Why sources skew toward “(not set)” or “direct” is covered in GA4 (not set) and direct traffic.

Double counting usually comes from tags left in the theme

Double-counted purchases happen when old GA4 tags are left in the theme or a custom pixel on top of the Google & YouTube app connection. In our experience, it’s the most common cause. Shopify’s help also says to manually remove existing pixel code from theme.liquid, checkout.liquid (Plus only) and checkout Additional scripts.

Purchase counts already recorded in GA4 can’t be corrected later. A data deletion request can remove parameter values, but the events still count in your metrics. Note the date you fixed it, and don’t compare numbers before and after directly.

After adding a consent banner, check two things separately: that the banner appears, and that declining actually stops data from going to GA4. A visible banner doesn’t prove the decline is respected.

On Shopify, in markets set to require consent (such as the EEA and the UK), web pixels run only when visitors have given the required permissions. The Google & YouTube app and custom pixels follow this setting; tags pasted directly into theme code don’t. If you run GTM or Google tags in a custom pixel, you have to write the Consent Mode code yourself.

Sources

FAQ

How do I connect Google Analytics 4 to Shopify?

Install Shopify's Google & YouTube app, then on the app's Overview page, find the section for setting up Google Analytics 4, select your GA4 property and connect it. The Google account you use needs Editor access or higher on that property. Once connected, the Google tag is added to your store and ecommerce events are sent automatically.

Should I use the Google & YouTube app or Google Tag Manager for GA4?

Use the Google & YouTube app unless you have a specific reason not to. Shopify recommends its built-in integration and warns that adding Google Analytics through GTM as well can result in duplicate tracking. If you use GTM, add it as a custom pixel under Settings > Customer events, not in your theme, and build GA4 events from Shopify's standard events. In that case, don't connect GA4 in the app. Note that Google says running Google tags inside Shopify's custom pixels isn't a supported implementation.

Where do I paste my GA4 measurement ID (G-) in Shopify?

If you connect the property in the Google & YouTube app, you don't need to paste it anywhere. If you can't connect because you lack access, or you want to send data to more than one property, go to the app's Settings page, click Manage in the Google tags section, and add the Google tag manually. Pasting it into your theme code isn't recommended, because tags there don't run on checkout or the thank you page.

I connected GA4, but no data shows up. Why?

First check whether your online store is password protected. Shopify's help says Google Analytics can't track events until you deactivate private mode. Then check whether your own visit appears in GA4's Realtime report. Other causes include a connection to the wrong property, declining analytics in a consent banner, and ad blockers.

Why don't GA4 purchases match my Shopify orders?

GA4 records a purchase when the tag runs in the buyer's browser. Purchases where the buyer doesn't return from an off-site payment gateway, buyers with ad blockers, checkouts that happen inside AI or social apps, and subscription renewals may never reach GA4, so GA4 usually shows fewer. In one of our client stores, connected through the Google & YouTube app, 21% of orders were missing from GA4. If GA4 shows more purchases than Shopify, suspect double counting from both the app and GTM. Either way, check by matching order numbers against GA4 transaction IDs one by one.

Why doesn't Shopify sales match GA4 revenue?

Because they're defined differently. The purchase value the Google & YouTube app sends to GA4 is after item and order discounts, and excludes shipping and tax. When you compare with a Shopify sales metric, align shipping, tax and returns with GA4's definition first. After that, GA4 comes up short by the purchases its tag couldn't track.

Key takeaways
  • The standard way to set up GA4 on Shopify is to connect your property in the Google & YouTube app. The Google account needs Editor access or higher on the property.
  • Once connected, page_view, view_item, add_to_cart, begin_checkout, add_payment_info, purchase and more are sent with no extra setup. The value on purchase and begin_checkout is after discounts and excludes shipping and tax.
  • Add GTM as a custom pixel. Running GA4 through both GTM and the app double counts. Tags written directly into your theme don't run on checkout or the thank you page.
  • After connecting, check Realtime, a test purchase, the transaction ID format, event data retention (14 months), internal traffic, and purchase conversions in Google Ads.
  • Even with the app set up correctly, some purchases can't be tracked by a tag. Match by order number to see how many are missing.

Written byRyushi Nagata

CEO, ULTRO Inc. (Tokyo)

Shopify Partner. Ryushi handles Shopify store builds, maintenance, advertising and CRM end to end, and has managed more than ¥4 billion in ad spend over his career. He holds Google Ads certifications (Search, Display, Video, Shopping, Apps, Performance Max, Measurement) and the Google Analytics certification.

How many purchases is GA4 missing in your store?

GapFill matches your Shopify orders against GA4 purchases, shows what GA4 missed, and recovers those purchase events server-side. It works alongside your existing tags, and the missing purchases report is free.

See GapFill →