The short version
Add GA4 to Shopify through the free-to-install Google & YouTube channel: connect your Google account, connect a GA4 property in the channel's Google Analytics section, then click Confirm.
Before you connect, find old gtag or Google Tag Manager code in your theme, checkout settings and Customer events, because a second tag beside the channel can count the same purchase twice.
Then place a test order: Realtime or DebugView shows the purchase arriving, and one matching request in developer tools shows it was sent once.
Many other reports can take 24–48 hours.
Which Route Fits Your Store
Most stores need the first row. The other three exist for one specific reason each — find yours in the first column.
How to get GA4 into Shopify, by situation
| Your situation | Pick | Why |
|---|---|---|
| You have the right access to the GA4 property and send data to one property | Google & YouTube channel, connect the property | Google calls this option strongly preferred, and Shopify's integration records ecommerce events for you |
| You lack the right access to the property, or need data in two or more properties | Google & YouTube channel, add the Google tag by hand | Google's fallback when you can't connect the property for any reason, such as missing access or needing several properties, set in the channel's own settings |
| You already run a Google Tag Manager container with many tags | GTM as a custom pixel, and no GA4 connection in the channel | Shopify warns that GA4 in GTM on top of its built-in integration can duplicate tracking |
| The channel is not offered for your country or currency | A custom pixel (GTM or gtag) | Google & YouTube is available only for certain countries and currencies; custom pixels are unsupported by Shopify |
Three Routes and What Each Sends
Key takeaway
GA4 does not replace the reports already inside your admin: it adds Google's view of the same traffic. What each tool is good for is a separate question, covered in our guide to Shopify's own analytics. This page is about getting GA4 in, once, and proving it counts each order once.
The Google & YouTube channel
Key takeaway
The channel is a free-to-install app called Google & YouTube, and its listing promises to connect the full ecommerce journey with insights in Google Analytics. If it is not installed yet, Shopify prompts you to install it during the GA4 setup anyway.
Shopify's help page on Google Tag Manager recommends its built-in integration because Shopify has the necessary logic built in to record Google Analytics Enhanced Ecommerce data. Google's own Shopify instructions go further and call connecting your GA4 web stream in the channel “strongly preferred”. The reason that matters most to you is upkeep: the events are mapped from Shopify's standard events without code of yours.
Shopify's page on replacing Google Tag Manager scripts on the Thank you page gives the reason in one line:
This option is recommended because the Google & YouTube app is maintained by Google, ensuring it stays up-to-date without requiring additional maintenance from you.
What the channel sends to GA4
Key takeaway
The list comes from Google, not Shopify: Google's reference for Shopify event parameters says the app helps automatically send important events and parameters for Google tags. We counted 11 events on that page on November 2, 2026, grouped below by the stage of the visit.
The 11 GA4 events the Google & YouTube channel sends
| Stage | GA4 events the channel sends | What to know |
|---|---|---|
| Browsing | page_view, view_item_list, view_item, search | — |
| Cart | add_to_cart, remove_from_cart, view_cart | — |
| Checkout | begin_checkout, add_shipping_info, add_payment_info | add_shipping_info only in checkouts where Checkout Extensibility for customizations is enabled |
| Order | purchase | The value leaves out shipping and taxes; since April 24, 2025 it also takes discounts into account (subtotal minus discounts) |
Google for Developers, Shopify event parameters for Google tags, read November 2, 2026.
Google adds that these events and parameters are mapped from Shopify's standard events, and that not all events contain user data. On top of them, the app sends standard measurement events, such as session_start, user_engagement and first_visit. If some of the newer events clutter a report, Google suggests filtering them in Google Analytics with the shopify_event_name parameter.
Google Tag Manager as a custom pixel
Key takeaway
Choose this route when a GTM container already carries your other tags and you want GA4 managed in the same place. Shopify's tutorial for Google Tag Manager as a custom pixel is clear about the price: tag managers loaded in its sandbox have the same restrictions as any other pixel. When GA4 runs there, page URLs may include information about the sandbox, and outbound link clicks from GA4's Enhanced measurement can't be triggered automatically. Shopify's page on replacing Google Tag Manager scripts adds that Google can't provide technical support for Google Tag Manager custom pixels.
The rule that decides this route is one sentence on Shopify's Google Tag Manager page. Pick GTM or the channel for GA4, never both:
Adding Google Analytics to Google Tag Manager in addition to using Shopify's built-in integration can result in duplicate tracking.
Testing is different here too: Shopify's page on replacing Google Tag Manager scripts says Google Tag Manager custom pixels can't be tested using Google Tag Assistant, while Shopify's GTM tutorial says the Tag Assistant page extension can test which Google tags load on the page but its Troubleshoot tag feature isn't compatible with custom pixels, and the tutorial tests a GTM custom pixel with the Shopify Pixel Helper.
The container setup itself — triggers, the data layer, consent — is a separate project, laid out step by step in our guide to installing GTM on Shopify the right way.
If you want to watch the build before you start, the video below shows it end to end. It is one practitioner's walkthrough (Loves Data, May 2024), not a Shopify source; its testing chapter starts at 12:33, and its resource list links the Tag Assistant Chrome extension, so for a GTM custom pixel test the events with the Shopify Pixel Helper, as Shopify's tutorial does, and your browser's developer tools.
A custom pixel with gtag
The same custom pixel slot can hold Google's gtag snippet instead of a GTM container, and then everything Shopify says about custom pixels applies: adding and using them is unsupported by Shopify, they load in a lax sandbox, and you insert the Google Consent Mode v2 snippet yourself. For where each kind of tracking code belongs in general, see where tracking code goes in Shopify.
Before You Connect
Key takeaway
Shopify's Google Analytics setup page starts with the Google side: you need a Google Analytics account and a GA4 property before the store can send anything. Each condition below has a place to check it and a way round it.
Five conditions to check before you connect
| Condition | Where you check it | If it is not met |
|---|---|---|
| A Google Analytics account and a GA4 property | Google Analytics admin | Create the property first; adding a property to an account needs the Editor role |
| The Tag ID of a web data stream (it starts with G-, as in G-XXXXXXXXXX) | The property's web data stream | Create a web data stream for your store's domain and note the Tag ID |
| Admin access to that property: the channel lists only properties where your Google account is an administrator | The property's access settings in Google Analytics | Ask the property's owner for access, or add the Google tag by hand in the channel |
| The online store is out of private mode | The access setting menu on the Online Store page, which shows Private or Public | Google Analytics can't track events until you deactivate private mode |
| The Google & YouTube channel is offered for your country and currency | Shopify's Google & YouTube channel page | Use a custom pixel instead |
Shopify Help Center (Google Analytics setup, Google & YouTube channel) and Google Analytics Help (creating a property, setting up on Shopify), read November 2, 2026.
The Editor role comes from Google's page on adding a property. Shopify's Google & YouTube page says the channel is available only for certain countries and currencies and links to Google's list.
One thing you can skip: Shopify says you don't have to connect to the Google Merchant Center to complete the GA4 tags setup. The same channel also syncs your products to Merchant Center for Shopping listings, a separate job covered in our Google Shopping guide.
Find Old Tracking Code First
Key takeaway
Most stores that open this page already have something installed: a snippet from an old tutorial, a Universal Analytics tag from years ago, a script in checkout settings. Inventory it before you connect, because what you do with each piece depends on where it lives.
Where old code hides
Key takeaway
Shopify's pixel migration guide names the places code was pasted by hand — theme.liquid, checkout.liquid (Shopify Plus only), Additional scripts in your checkout settings, and the Preferences page — and gives the search terms: Google pixels often use gtag() or dataLayer.push().
Where old Google code lived, and what to do with it now
| Where it lived | Who has it | What happened to it | What to do |
|---|---|---|---|
| theme.liquid and other theme Liquid files | Any store that pasted a Google snippet into the theme | Still in the theme until someone removes it | Search your theme's Liquid files, starting with theme.liquid, for gtag( and dataLayer.push( and delete the Google tag code |
| Additional scripts in checkout settings | Stores on all plans | Shopify says they aren't supported on the new Thank you and Order status pages | If one is still listed, replace its tracking with a pixel and check the test order for a second purchase |
| checkout.liquid | Shopify Plus only | Customizations on the Thank you and Order status pages are lost in the automatic upgrade | Rebuild what you still need as a pixel; do not count on the old file |
| Online Store > Preferences | Stores that pasted a Universal Analytics tag there | UA tags not set up through the Google app were removed in February 2025; a tag not moved to the channel was converted to a custom pixel | Look for it under Settings > Customer events and delete it |
| Settings > Customer events (custom pixels) | Any store with a custom pixel | Runs alongside whatever else sends the same events | Remove or modify it before adding a new custom pixel |
| Other apps with their own tracking | Any store | The same event can be tracked more than once | Check each app's settings for its own Google tag |
Shopify Help Center pages on pixel migration, managing custom pixels, Additional scripts and Google Tag Manager, read November 2, 2026.
The Customer events page is where the newer pieces sit. Its list is called Pixels: in our development store on November 2, 2026 it held app pixels, Google & YouTube among them, and the Add custom pixel button sits on the same page. A tag Shopify converted from the old Preferences page is a custom pixel, so this is the page to look for it. If the page is greyed out for you, that is a permissions question, answered in why Customer events can be greyed out.
- Settings
- Customer events
Checkout leftovers are the ones people forget, because the pages they ran on changed under them. Shopify's troubleshooting note is explicit about it:
If you previously added tracking code through Additional scripts or checkout.liquid, then any leftover code there can also cause duplicate tracking.
Remove first or connect first?
Key takeaway
For a custom pixel, Shopify's instructions for adding one say to remove or modify any existing pixels first, so customer events aren't counted twice. For Additional scripts, its upgrade page gives both orders: connect the pixel before deactivating the script, which leaves a short period of duplicate events, or deactivate the script first to prevent any duplicates.
Go by where the old code sits. An old custom pixel, including a Preferences tag that Shopify converted into one: remove it before you add a new custom pixel (the GTM or gtag routes); on the channel route, remove it in the same sitting you connect GA4.
Additional scripts: Shopify says they aren't supported on the new Thank you and Order status pages, and stores not upgraded by August 26, 2026 were upgraded automatically. Shopify's pixel migration page still names leftover code in Additional scripts as a cause of duplicate tracking, so if your checkout settings still list a script, replace its tracking with a pixel and check the test order for a second purchase.
A snippet in theme.liquid or another theme Liquid file: delete it in the same sitting in which you connect GA4 in the channel, so the overlap stays short.
For a theme snippet, removing first leaves a window with no tracking, and removing last leaves a window where both run and the same purchase can arrive twice. Shopify also warns that after you replace additional scripts with pixels you might notice fewer events, because pixel events only run with the visitor's consent where consent is required.
What already stopped working
Key takeaway
Every date below has passed, so none of this is preparation. It explains why an old snippet is either dead weight or a duplicate: dead if it still points at Universal Analytics, a duplicate if it sends GA4 events next to the channel.
Connect GA4 Through the Google & YouTube Channel
Key takeaway
Shopify's page on connecting Google Analytics in the channel says you can connect an existing GA4 property or create a new one. The steps below follow Shopify's and Google's help, with the setup page we opened on November 2, 2026 in the screenshots:
- Add the channel. Install Google & YouTube from the Shopify App Store; it then appears under Sales channels in the left menu.
- Connect your Google account. The setup page opens with the heading Get started with Google & YouTube, and the card Set up your online store lists Your Google account as its first task.
- Connect the property. Shopify's help starts this from the Looking only to set up Google Analytics 4? banner: click Get started, select an existing property from the drop-down menu or create a new one, then click Connect. On our setup page, Google Analytics had its own section further down, Understand your traffic with Google Analytics, with two tasks.
- Confirm. Google's GA4 instructions add one more click after Connect: click Confirm.
- Sales channels
- Google & YouTube
- Sales channels
- Google & YouTube
Shopify's help calls the entry point a banner, “Looking only to set up Google Analytics 4?”, and Google's help a section on the channel's Overview page, “Just want to set up Google Analytics 4”; both lead to Get started, choosing the property and Connect.
Adding the Google tag by hand
Google keeps a fallback inside the channel for when you can't use the connection for any reason, such as not having the right access or needing to send data to more than one GA4 property. Then you add your Google tag, the ID starting with G-, under the channel's Settings > Google tags > Manage. Google's instructions for a G- tag put it in one line: “You can manually add Google tags for additional Google Analytics properties (or other Google services).”
Consent: What Reaches GA4 When Visitors Decline
Key takeaway
Consent decides how much of your traffic GA4 ever sees, and it is set in two places: Shopify's customer privacy settings decide who is asked, and Google's consent mode decides what its tags do with the answer.
Who sees a banner
Key takeaway
Shopify's pixel privacy rule is short: in markets configured to require consent, usually the European Economic Area and the United Kingdom, web pixels run only when visitors have provided the permissions required in the pixel configuration. By default, new pixels require Marketing and Analytics permissions.
For a new store with active markets in the UK and EEA, Shopify sets up its own cookie banner for visitors there automatically. If you run a third-party consent tool instead, it must sync consent to Shopify through the Customer Privacy API, and Shopify asks you to use the same consent regions in its settings and in the app — otherwise non-essential data may be processed before consent. How to switch the banner on and pick regions is covered in our privacy compliance guide.
- Settings
- Customer privacy
- Cookie banner
None of the Shopify pages we read on November 2, 2026 names the channel's GA4 tag in the pixel privacy rule above, which is written for web pixels. Google's page on setting up Shopify to obtain user consent says that if you use the Google & YouTube app for conversion tracking and have set up a consent tool that integrates with Shopify's Customer Privacy API, consent mode should work automatically, and that after you enable Shopify's cookie banner, consent mode is enabled automatically.
Shopify's pixel migration page also warns that a Google Analytics tag never moved to the channel, and converted to a custom pixel instead, might have its consent treatment changed. Test with the banner accepted and declined, and look at what arrives.
Basic or advanced consent mode
Key takeaway
Google describes the two modes on its consent mode overview, and Shopify adds the advertising consequence for customers such as those in the EEA. Read the table by what happens to a visitor who says no:
What reaches Google when a visitor declines
| Situation | What reaches Google | Who says so |
|---|---|---|
| A web pixel that requires permissions, a visitor in a market that requires consent, permission not given | Nothing: the pixel does not run | Shopify |
| Basic consent mode, the visitor declines | No data at all, not even the consent status | |
| Advanced consent mode, the visitor declines | Measurements without cookies (cookieless pings) | |
| Event data from customers such as those in the EEA, without Google Consent Mode v2 | Not used for personalized advertising | Shopify |
Shopify Help Center (pixels overview, understanding customer privacy settings) and Google (consent mode overview, Google Analytics Help), read November 2, 2026.
On a custom web pixel, Shopify's page on customer privacy settings says to manually insert a code snippet to activate Google Consent Mode v2. If you block Google tags until the visitor consents, Google says in its Analytics help on consent mode that you will not get the full benefits of consent mode.
Check That Each Order Sends One Purchase
Key takeaway
A connected channel tells you nothing about counting. The test that matters is one order and one purchase event, checked with the tools below.
Which test tool shows what
Key takeaway
Each tool answers a different question, and two of them stop working in situations common on new stores. Realtime is the first place to look, Google's duplicate-tag check uses Tag Assistant, and Shopify documents its Pixel Helper on the pixel testing page.
Five ways to see what your store sends
| Tool | What it shows | Where it falls short |
|---|---|---|
| GA4 Realtime report | Users on your site in the last 30 minutes, and events as they arrive | Shows arrival, not whether a purchase was counted once |
| GA4 DebugView | Events from a browser in debug mode, one by one | Debug mode must be on; events are hidden without consent for Analytics cookies |
| Google Tag Assistant | A Hits sent tab with a box for each event sent from your site | Its Troubleshoot tag feature doesn't detect Google tags inside a custom pixel |
| Shopify Pixel Helper | Whether a pixel receives data when events occur | Not compatible with headless stores or stores in private mode |
| Browser developer tools | Every request the page sends | Duplicates show as several requests to the same analytics endpoint for one event |
Google Analytics Help (Realtime, DebugView), Google Merchant Center Help (duplicate conversions) and Shopify Help Center (app pixels, custom pixel testing, the Google Tag Manager custom pixel tutorial, pixel migration), read November 2, 2026.
The most common false alarm is an empty DebugView on a store with a cookie banner. Google spells out why:
Events are not visible in debug mode if you have implemented privacy controls on the client-side, or if you've implemented consent mode and users have not given consent for Analytics cookies.
Run a test order
Key takeaway
- Open the store like a shopper. Take the online store out of private mode and accept analytics cookies if your banner asks.
- Turn on debug mode for your browser, since DebugView needs it. For your own device, Google's DebugView help says to use Google Tag Assistant or preview mode; Tag Assistant adds a parameter to your website address to enable debug mode. Then open DebugView or Realtime in GA4. For a custom pixel, Shopify's replacement guide says Google Tag Assistant isn't compatible, and Shopify's own test tool is the Shopify Pixel Helper; pair it with Realtime and your developer tools.
- Place a test order and go all the way to the Thank you page.
- Count the purchase. Realtime or DebugView shows the purchase arriving, and one matching request to the analytics endpoint in the network tab of your developer tools shows it was sent once.
- Wait before judging reports. Google says many reports and explorations can take 24–48 hours to process data.
If purchases show up twice
Key takeaway
Work through the usual senders, in this order:
- GA4 connected twice — once in the channel and once in a Google Tag Manager container (Shopify's duplicate-tracking warning above).
- Leftover checkout code in Additional scripts or checkout.liquid.
- The same event tracked in several places — Shopify calls tracking the same event more than once a common issue when migrating.
- Several Google tags, or conversion tracking set up before the channel — Google warns this can count one action more than once for ads and free listings.
GA4 has one safety net, and it is narrow. Google's transaction ID deduplication removes a purchase registered twice with the same transaction ID, and it works for web streams only, not app streams.
If you send purchases from your own custom pixel, give each one a transaction ID and never an empty string. None of the Shopify or Google pages we read says that deduplication makes it safe to run the channel and a second Google tag side by side — remove the second sender.
Why GA4 and Shopify Won't Match
Key takeaway
A correct setup still disagrees with your Shopify reports, for reasons that have nothing to do with tags:
- Blocked tracking. Shopify's page on analytics discrepancies notes that customers can use browser extensions to block Google Analytics from tracking their sessions and purchases.
- Consent. Where a cookie banner is active, data from visitors in those regions is collected only after they consent.
- Bots. Google says traffic from known bots and spiders is excluded from GA4 automatically, and Shopify expects single-digit percentage dips in event counts after a move to web pixels, because some bots don't trigger the pixel sandbox.
- Discounts. Since April 24, 2025, the purchase value the channel's Google tags send is the subtotal minus discounts, and Google's reference notes it does not include shipping charges and taxes, so compare it with a Shopify sales figure calculated the same way.
Session counts are where the two drift furthest, and that gap has its own explanation in our breakdown of why Shopify and GA4 never agree on sessions.
The Setup Checklist
Key takeaway
Steps one and two apply to every route. If you chose a custom pixel (GTM or gtag), Shopify's custom pixel page says to remove or modify existing pixels before you add one, so customer events aren't counted twice: do step five, old custom pixels and theme snippets alike, before step four, which then happens in Customer events instead of the channel, so its channel checks don't apply. Step three is the one that stops you connecting GA4 twice.
GA4 on Shopify: setup checklistTick each step as you finish it; your progress stays in this browser.
GA4 on Shopify: setup checklist
Tick each step as you finish it; your progress stays in this browser.
Have a GA4 property with a web data stream, admin access to it, and an online store out of private mode.
Before you tick this off
- The GA4 property exists and its web data stream has a Tag ID starting with G-
- Your Google account has admin access to that property, or you will add the Google tag by hand
- The online store is out of private mode
- The Google & YouTube channel is offered for your country and currency, or you chose a custom pixel
Find every Google snippet in your theme's Liquid files, Additional scripts, checkout.liquid on Plus, Customer events and other apps before you connect anything.
Before you tick this off
- Theme Liquid files, theme.liquid first, searched for gtag( and dataLayer.push(
- Additional scripts in checkout settings (and checkout.liquid on Plus) checked and noted
- Settings > Customer events checked for custom pixels, including a converted Preferences tag
- Apps with their own Google tag noted
Choose the channel, the channel with a hand-added Google tag, or a custom pixel (GTM or gtag), and never two routes for GA4.
Before you tick this off
- One route chosen and written down
- If a custom pixel (GTM or gtag): GA4 will not also be connected in the channel
Install Google & YouTube, connect your Google account, connect the GA4 property and click Confirm.
Before you tick this off
- Google & YouTube appears under Sales channels
- The GA4 property is connected in the Google Analytics section
- Confirm clicked after the property was connected
Delete the old custom pixels and theme snippets you listed. Additional scripts: Shopify says they aren't supported on the new Thank you and Order status pages; if your checkout settings still list one, replace its tracking with a pixel and check the test order for a second purchase.
Before you tick this off
- Old theme snippet deleted
- Converted or old custom pixels removed
Decide where the cookie banner shows, and match those regions in any third-party consent app.
Before you tick this off
- Cookie banner regions set under Settings > Customer privacy
- A third-party banner syncs consent through the Customer Privacy API
- On a custom pixel: the Consent Mode v2 snippet is in place
Accept analytics cookies, complete a test order to the Thank you page, and confirm the purchase arrives in GA4 and was sent once.
Before you tick this off
- Realtime or DebugView shows the purchase arriving
- Developer tools show one matching request for the purchase, so it was sent once
- You know many other reports can take 24–48 hours
- Any additional script still listed in checkout settings: tracking replaced with a pixel, and no second purchase in the test order
The Bottom Line
Key takeaway
Adding GA4 to Shopify takes a few screens. Trusting it takes an inventory of what was already installed and one test order.
Frequently Asked Questions
Front-end developer specializing in Shopify since 2017. Experienced in building custom Liquid themes, optimizing storefront performance, and integrating third-party apps. Directs the editorial process behind Ecom Store Pro: sets its topics and the rules every AI-written page must pass before publication.
This page was written by AI. Separate AI agents that did not write it check its figures and claims against official sources and test its links and interactive tools. A human editor sets the site's editorial direction, topics and rules and checks that pages are complete and display correctly, but does not check their facts or edit their text. Details may change — always confirm critical data at shopify.com.
Editorial PolicySome links in this article are affiliate links. If you sign up for a Shopify store through these links, we may earn a commission at no extra cost to you. Read our full advertising policy.
