← All postsHow Do You Add Google Analytics to Shopify?

How Do You Add Google Analytics to Shopify?

Carlos GarciaCarlos GarciaPublished

How Do You Add Google Analytics to Shopify?

If you have looked this up before and followed the instructions you found, there is a good chance they told you to paste a measurement ID into a field that no longer exists. Shopify removed that field, and it documents the removal with a date. Most of the advice still circulating was written against a Shopify admin that has since been rebuilt twice.

This guide uses only what Shopify, Google and the Shopify App Store actually publish today. Where their pages disagree with each other, which happens more than once in this topic, that is noted rather than smoothed over, because the disagreement is usually the thing that wastes an afternoon.

Where Do You Add Google Analytics to Shopify Now?

The short answer is that you no longer add Google Analytics to Shopify by pasting a tag anywhere. You install an app, connect a property, and let the app place the tag for you.

Shopify's own Google Analytics 4 setup page opens with the instruction to "Install the Google & YouTube sales channel to your Shopify store." That channel is published by Google LLC, and the App Store listing for it is marked "Free to install. Additional charges may apply." The additional charges refer to advertising spend, which is billed by Google rather than Shopify, and none of it is required to use the analytics half of the app.

Once the channel is installed, the connection itself happens inside it. Shopify's Google channel documentation gives the path as "From your Shopify admin, go to Sales channels > Google & YouTube." From there you are looking for the banner Shopify labels "Looking only to set up Google Analytics 4?" and a "Connect a Google Analytics property" section where you "select or create a GA4 property" and then "Click Connect."

Two details are worth knowing before you start, because they remove the most common blockers. Shopify states plainly that "You don't have to connect to the Google Merchant Center to complete your GA4 tags setup process," so the product-feed requirements you may have read about do not apply to analytics. And the GA4 setup page itself contains no admin navigation path at all, which is why so many write-ups invent one. The path above comes from a different Shopify page, and if you go looking for it on the page Shopify titles as the GA4 setup guide you will not find it.

Google describes the same one-click connection as the preferred route in its own words: "Option 1 is strongly preferred." That is a useful sentence to keep in mind, because the alternative route exists and is easy to reach by accident.

Not sure whether your store is tracking what you think it is? Get a free technical audit of your site at https://www.seo-stuff.com/free-audit and find out what your analytics is actually recording.

Free audit

Where do you stand in AI search?

A manual SEO + AI search audit of your site: how ChatGPT, Gemini, Perplexity and Claude read and cite it today, and what to fix first. Report within 48 hours, no credit card.

Get my free audit

Or have it all done: AI SEO services, $999 once

What Happened to the Google Analytics Field in Preferences?

For years, the answer to this question was a single field under Online Store > Preferences. That field is gone, and Shopify documents exactly when and why.

Shopify's pixel migration page states that as of February 2025, Meta pixels and Google Universal Analytics tags that were not set up through their respective apps "have been removed" from the Preferences page of the Online Store section in the admin, and that those pixels were "converted to custom pixels" under the Customer Events settings. That is a migration, not a deletion, which matters: if you had a tag in that field, it probably still exists somewhere in your store.

The current Preferences page confirms the removal by omission. The fields Shopify documents there now are store access and private mode, automatic redirection, automatic hreflang tags, the social sharing image and home page SEO settings, spam protection through hCaptcha, and trusted domains. No sentence on that page contains the word Google.

Universal Analytics is irrelevant to anything you are setting up today. Shopify's own migration subpage notes that "Universal Analytics properties stopped processing new data on July 1, 2023." That page is still published and still linked from Shopify's Google Analytics hub, and its content predates the February 2025 Preferences removal, which is one of the clearest examples in this topic of a live vendor page describing an admin that no longer exists.

So if an instruction you are reading mentions Preferences, Universal Analytics, a UA- prefix, or a measurement ID field in the Online Store section, you can stop reading it. None of those four things is part of the current setup. The place a manual tag now lives is inside the Google & YouTube app, covered below.

How Do You Connect GA4 Through the Google & YouTube Channel?

The documented flow is short, and most of the time it works on the first attempt. The steps below are the first-party ones, in order, with the things that tend to go wrong attached to the step where they bite.

Step 1: Create or identify the GA4 property first. You need a Google account with sufficient access to the property you intend to connect. If you create the property during the flow instead, you will own it under whichever Google account you happened to be signed in as, which is a problem you will not notice for months.

Step 2: Install the Google & YouTube channel. Shopify's instruction is to install it as a sales channel, and the App Store listing is free to install. Installing it does not commit you to running advertising or syncing products.

Step 3: Take your store out of private mode. Shopify is unambiguous about this one: "Google Analytics can't track events until you deactivate private mode for your online store." A store still gated for a pre-launch audience will connect successfully and then report nothing, which looks identical to a broken tag.

Step 4: Open the channel and start the analytics-only flow. Go to Sales channels > Google & YouTube, then use the banner for setting up Google Analytics 4 on its own rather than working through the full advertising onboarding.

Step 5: Connect the property. In the "Connect a Google Analytics property" section, select or create the GA4 property and click Connect. Shopify notes that you can reverse this at any point by clicking Disconnect, which is worth remembering if you are testing against a scratch property first.

Step 6: Remove any older tag you were using. This is the step most setups skip, and it is the one that corrupts the data. Google's guidance is direct: "Make sure you remove your legacy tags to avoid duplicate tagging." If your store predates February 2025, assume a legacy tag exists until you have checked.

A clean analytics setup is worth very little if the rest of the site is leaking traffic. Request a free audit at https://www.seo-stuff.com/free-audit for a plain-English list of what to fix first.

When Should You Add the Google Tag Manually Instead?

The one-click connection covers most stores, and Google says so. It also documents a manual route, and names the two situations that call for it.

Google's Shopify setup article describes the manual option as the thing to use "If you can't use it for any reason, such as not having the right access" or "or needing to send data to multiple Google Analytics properties." The second of those is the common one in practice: an agency property plus a client property, or a regional property alongside a global one.

The manual tag does not go into a theme file. It goes into the same app: "In the Google & YouTube app, navigate to the "Settings" page," then "In the "Google tags" section click Manage," then save and complete setup. If you have been hunting for where the measurement ID field went after February 2025, this is where it went.

Choosing the manual route has a cost that is easy to miss. Because you are no longer letting the app configure the tag through the supported path, you also lose the assumption that any troubleshooting guide written for the standard install applies to you. Several of Google's own verification steps assume you control the tag configuration directly, and on a one-click install you do not.

There is also a third route, which is a custom pixel. It is documented, it works, and Shopify explicitly does not support it. Treat it as the option for a genuine custom tracking requirement rather than as a way to avoid the app.

Which Events Does Shopify Send to GA4?

Here the honest answer is an absence, and it is a useful one, because almost every competing article presents a confident event list that no first-party page supports.

Shopify's GA4 setup page says only that "After you set up Google Analytics 4 tags, certain ecommerce events are tracked automatically." It does not name a single event. Google's side of the documentation says the tag is added for sitewide measurement including ecommerce events and parameters, and likewise names none for the Shopify integration.

The closest thing to a list is for a different implementation. Shopify's Google Tag Manager tutorial, which covers the custom-pixel route rather than the native app, publishes a partial mapping of Shopify customer events to GA4 event names:

  • product_viewed maps to view_item, and collection_viewed to view_item_list
  • product_added_to_cart maps to add_to_cart, and product_removed_from_cart to remove_from_cart
  • cart_viewed maps to view_cart
  • checkout_started maps to begin_checkout
  • checkout_completed maps to purchase

That mapping is real, it is first-party, and it is published as a set of examples for custom pixels. Do not read it as the native app's event schedule, because Shopify never says it is.

What is documented for the app is narrower and comes from Google: purchase, add to cart and checkout started are described as the suggested default conversion actions in Google Ads, with Shopify mapping each to a Shopify event. That is conversion tracking rather than a GA4 event list, and it is as close as the first-party record gets.

What Happened to checkout.liquid and Additional Scripts?

If your tracking ever lived in checkout.liquid or in the Additional scripts box, that era is over, and it ended on a schedule Shopify published in advance. The dates are spread across three different first-party pages, which is why so few write-ups have all of them.

Shopify's changelog post on the deprecation states that "checkout.liquid customizations will no longer work for in-checkout pages starting August 13, 2024," covering the Information, Shipping and Payment steps. Shopify's developer documentation now states the same deprecation without any date, which reads like a contradiction and is not one: the changelog is the dated source of record, and the dev docs dropped the date once it had passed.

The second date is the one that removed the last analytics hiding place. Shopify's developer docs state that "checkout.liquid and additional scripts were sunset for the Thank you and Order status pages on August 28, 2025." Shopify's help center carries the same deadline and adds the consequence: automatic upgrades began in January 2026, and customizations using additional scripts, apps with script tags, or checkout.liquid on those pages were lost.

Script tags have their own timetable, and part of it is still ahead of you:

  • Thank you and Order status pages: sunset August 28, 2025 for Plus stores, and August 26, 2026 for non-Plus stores
  • Creation: "You can't create or update a script tag after October 1, 2026"
  • Storefronts: "script tags will stop running on storefronts on March 1, 2027"

That last date is the only live deadline left in this list, and Shopify publishes it without saying which plans it covers, so read it as applying to yours. The replacement for anything that "only collects analytics or conversion data," in Shopify's own framing, is a web pixel.

One point of confusion deserves correcting directly, because the plan language invites it. Shopify states that "The checkout.liquid layout renders the checkout and is available only to Shopify Plus merchants." Being on Plus does not mean the deprecated surfaces still work for you. Availability and support are different things, and both sunset statements apply regardless of plan.

Old tracking code left behind in a theme is one of the most common sources of bad data. Get a free audit at https://www.seo-stuff.com/free-audit and see what is still firing on your store.

How Do You Add Google Tag Manager to Shopify?

Google Tag Manager is supported on Shopify, but not in the way most instructions describe, and Shopify's own page opens by talking you out of layering it on top of the native integration.

Shopify states that "Google Tag Manager is available to all Shopify stores with custom web pixel" and draws the distinction between the two tools plainly: "Google Analytics is the tool that provides reports about activity on your store," while "Google Tag Manager is a tool that triggers your tracking codes based on defined rules." It then adds the sentence that settles most arguments about whether you need both: "Google Tag Manager doesn't replace Google Analytics."

The container does not go into theme.liquid. Shopify documents the install through a custom pixel: in Tag Manager you take the head code block, strip the surrounding HTML and script tags, and paste the remainder into a new custom pixel in Shopify. The pixel then subscribes to customer events and pushes them to the data layer, and you build a matching custom-event trigger, tag and data layer variable on the Tag Manager side for each value you want.

The pixel itself is created at Settings > Customer events in the Shopify admin, where the controls are Add pixel, Save, Connect pixel, Connect, Disconnect and Delete. Shopify recommends its built-in Google Analytics integration first and warns that adding Tag Manager over it can produce duplicate tracking, so pick one path per property rather than running both.

Three documented limitations of the custom-pixel sandbox are worth reading before you commit to this route. Shopify states that "Shopify doesn't support adding custom data to standard events at this time." Enhanced measurement events such as outbound link clicks cannot be triggered automatically from a custom pixel, for stated security reasons. And there is no equivalent to Tag Manager's stateful data layer inside the sandbox, which changes how you have to carry values between events.

The largest caveat is about support rather than capability. Custom pixels are an advanced feature, Shopify does not support adding or using them, and consent handling, code security and troubleshooting sit with you.

How Do You Check That It Is Working?

Three verification tools are documented, and the thing almost every guide gets wrong is which tool belongs to which setup.

For a standard install through the Google & YouTube channel, Google Tag Assistant is the documented check. You open tagassistant.google.com, click Add domain, enter the URL including https://, click Connect, browse the site in the debug window that opens, then stop debugging. Google's Analytics-side instructions add the interpretation: confirm your tag appears among the detected tags, then open the Summary tab to see whether events were sent. Events in Summary means the tag is working; a detected tag with no events usually means the tag is not connected to its destination; no tag detected at all points at the site code or the measurement ID.

The GA4 Realtime report is the second check, and it answers a different question. It covers the last 30 minutes, so it tells you whether data is arriving now. It will not confirm your historical reports, because, as Google states, "Many of your reports and explorations can take 24-48 hours to process data from your website or app." A store that connected an hour ago and shows nothing in standard reports is usually fine.

DebugView is the third, and this is where the native install diverges. Google's path for it is to "go to Admin, then under Data display, click DebugView," with the condition that "You must enable debug mode to use DebugView." Debug mode is enabled through Tag Assistant preview, a gtag config parameter, or a Tag Manager setting, and the last two require control of the tag configuration that a one-click install does not give you. Treat DebugView as a tool for Tag Manager and custom-pixel setups, and Realtime plus Tag Assistant as the check for the native app.

If you went the custom-pixel route, Shopify publishes its own tester, and you need it: Tag Assistant's troubleshoot feature does not detect Google tags that live inside a custom pixel. The documented flow is Settings > Customer events, check the Status column, open the pixel and click Test, then trigger a page view, a product view, an add to cart, a started checkout, shipping information and a completed test order, watching Events received for a green indicator on each.

That tester has limits of its own. Only one custom pixel can be tested at a time, you cannot edit a pixel while it is running, logs clear when you navigate, and it works with neither headless storefronts nor stores in private mode.

Why Do Shopify and GA4 Numbers Disagree?

They will disagree, they are supposed to disagree, and Shopify publishes the reasons, which is unusual enough to be worth quoting. Chasing a match between the two is the single biggest waste of time in Shopify analytics.

Shopify's discrepancies page states that "You sometimes have different results between Shopify analytics and third-party tracking services such as Google Analytics," and then explains several of the mechanisms behind it:

  • "Google counts every page reload, but a browser doesn't count reloads of cached pages."
  • "Google can only count visitors with JavaScript and cookies activated."
  • "Customers can use browser extensions to block Google Analytics from tracking their sessions and purchases."
  • Bot filtering differs between the two systems, and so can the reporting time zone

Shopify then closes the door on reconciling the gap precisely: "Details of recording mechanisms are proprietary information and are never shared." You can explain the direction of a discrepancy from the list above, but you cannot audit it to zero, and no setting changes that.

Self-referrals are the second recurring problem, and this one you can fix. Shopify warns that the Referral Traffic report may list sources you did not expect, including the checkout page, and recommends excluding your own primary domain, the Shopify checkout domain, the Shop Pay domain and any external payment providers you use, such as PayPal. Shopify gives no in-app path for this and defers to Google's referral-exclusion instructions, which live on the GA4 side under your data stream settings.

There is one more constraint worth planning around if you advertise. Google notes that the Google & YouTube app supports directly linking only a single Google Ads account, and that Floodlight has to be configured manually. For a single store that is a non-issue, and for a multi-brand setup it is an architectural decision rather than a configuration one.

How Does This Compare to the Alternatives?

The real comparison is not Shopify's integration against some other analytics product. It is the one-click app against the two routes people reach for when the app frustrates them.

Against a manual tag in the app settings, the one-click connection wins unless you specifically need multiple properties or lack the Google access to complete the supported flow. Google calls the one-click route strongly preferred, and the manual route costs you the assumption that standard troubleshooting guides apply to your store.

Against Tag Manager, the question is whether you need rule-based firing of other tags. If you are only sending ecommerce data to GA4, the app does it with less to maintain and no custom-pixel sandbox to work around. If you are running several vendors' tags with conditions, Tag Manager earns its place, and the duplicate-tracking warning means you should route GA4 through one of them rather than both. The same thinking applies to anything else you plan to install that touches the tag layer: if you have been wondering where your Google Analytics tracking code actually lives now that the theme file and Preferences routes are gone, the answer is that the app holds it, which is also why removing a stale duplicate is a job in the app or the theme rather than in Preferences.

Against doing nothing, Shopify's own analytics is genuinely good for orders, sessions and product performance, and for many small stores it is enough. GA4 earns its setup cost when you need acquisition detail Shopify does not model, cross-device behavior, or a shared property for paid campaigns. Install it because you will use one of those, not because a checklist said to.

One cross-vendor contradiction is worth carrying away, because it will send you to the wrong place. Google's duplicate-tracking removal page still instructs merchants to look for legacy tags under Settings > Checkout in the Additional scripts section, and in checkout.liquid. Shopify's own documentation says additional scripts were sunset on those pages in August 2025 and that automatic upgrades in January 2026 removed what was left. For most stores today, theme.liquid and custom pixels are the two places a duplicate tag can still be hiding. Google's search strings are the useful part of that page: gtag, UA-, AW-, GTM-, google-analytics.com, googletagmanager.com and googleadservices.com.

Want someone to confirm your tracking is clean before you spend on ads? Claim a free audit at https://www.seo-stuff.com/free-audit.

Final Thoughts

The setup itself is now a five-minute job, and the time cost has moved entirely into knowing which instructions to ignore. Install the Google & YouTube channel, connect the property inside it, take the store out of private mode, and remove whatever legacy tag the February 2025 migration left behind.

The two things most likely to cost you real money are a duplicate tag quietly inflating your conversions, and a reconciliation project between Shopify and GA4 that cannot succeed. Shopify has published the reasons those numbers differ; treating that as a settled fact rather than a bug frees up the hours better spent on what the data is telling you.

Finally, note the one date still ahead of you. Script tags stop running on storefronts on March 1, 2027, and Shopify states that without naming the plans it affects. If anything on your store still depends on one, that is the deadline to plan against rather than discover.

Want this done for you?

SEO Stuff gets businesses cited by ChatGPT, Gemini, Perplexity and Claude, and ranking in Google. Start with the free audit, a call, or the package.

See where you stand

A free, manual SEO + AI search audit of your site, with a report within 48 hours. No credit card, no sales call.

Get my free audit

Talk it through

A free 15-minute call with the founder about whether AI search is a meaningful opportunity for your business.

Free strategy call

Have it done

The Done-For-You Package: audit, 10 pages of content, 3 DR50+ placements, dashboard. $999 once, delivered in 21 business days.

See the package