In short: Shopify’s “Google Analytics stub called with” console error means something on the page still calls the old Universal Analytics ga function. The stub only queues and logs the call, so the fix is to find the caller, usually a leftover Universal Analytics tag in a tag container, and pause it.
Open the browser console on a Shopify storefront and you may see a red message that starts "Shopify's Google Analytics stub called with", followed by a list of values. It does not break the page and shoppers never see it. It is a sign that old tracking code is still running. This guide explains what the stub is, how to find what calls it, and how to switch the caller off in a way you can undo.
What does "Google Analytics stub called with" mean?
Shopify adds a small inline script to the head of each storefront page. If no function called ga exists yet, the script creates one. That function does three things when anything calls it: it adds the call's arguments to a list called ga.q, it writes the error you see in the console, and it reports the call to Shopify's own analytics as a ga_stub_called event. It sends nothing to Google. The console message ends with a link to Shopify's pixel migration page[1].
The name ga comes from Universal Analytics, Google's older analytics product. Standard Universal Analytics properties stopped processing data on 1 July 2023, and access to the old data and to the properties ended in July 2024[2]. Shopify's migration page says Google tags that were not moved to the Google & YouTube channel app were converted to a custom pixel, and tells store owners to remove old tracking code and event calls[1]. So the message points at a leftover: some script still talks to an analytics product that no longer receives anything.
What did a test show?
To see what the stub does, we copied its inline script word for word into four plain HTML pages and loaded each in Chrome 156, driven by Playwright 1.49.1. The pages call ga the way old tracking code does: a create command with a made-up Universal Analytics property ID, then a send command for a page view. There is no Shopify object on these pages, so the step that reports the call to Shopify did not run; that part rests on reading the code.
| Test page | Console | What the page ended up with |
|---|---|---|
| Stub, then the two calls | One error per call, each listing its arguments | ga is still the stub; ga.q holds both calls |
| Stub, then the standard Universal Analytics loader, then the two calls | One error per call, because the library had not loaded yet | The library file was requested and then replaced ga with its own function |
| No stub, standard loader, same calls | Silent | The library's ga |
| Stub, no calls | Silent | ga is the stub; ga.q does not exist |
Three things follow. The error appears once per call, and the arguments it lists name the caller's intent: a create command with a property ID starting UA- is a Universal Analytics tag starting up. A stub that nothing calls stays silent, so a clean console after your fix is the right result and you should not try to remove the stub. And the message only appears for calls made while the stub is the ga function, which is why timing matters when you hunt for the caller.
How do you find what is calling ga?
- Read the arguments. In the console message, look for a command name such as create or send and an ID that starts UA-. Type ga.q in the console to list every call queued so far.
- Find which containers load. Search the page source for googletagmanager.com. Shopify stores can load more than one tag container: the theme can add one, and the Google & YouTube channel's pixel can add another. In the page source, the channel's pixel settings list its tag IDs under google_tag_ids, which is where a second container shows up.
- Open each container and filter its tags by type. Look for the Universal Analytics tag type. Also search Custom HTML tags for the text ga( and, in the theme code, for ga( and analytics.js.
- Check the caller really is the page. Tag Manager's preview mode shows which tags fire on a page load. A browser extension such as Omnibug, which decodes analytics requests into readable form, shows what leaves the browser[3].

Pick the tool by what you can edit. If you cannot open the container, steps 1 and 2 are enough to tell the person who can. If you can, the tag list in step 3 gives the full list in one place.
What did we find on a Shopify store?
On one Shopify store the console showed the stub message, and the theme's own container turned out to be clean. The second container, the one added by the Google & YouTube channel's pixel, still held 23 Universal Analytics tags for a property that had stopped processing in 2023. Nothing had been published to that container for more than a year, and its other tags were GA4 and a handful of custom ones.
All 23 Universal Analytics tags were paused in one container version, with nothing else changed. The check made after the change found no stub messages and unchanged GA4 and Google Ads hits. A later look at the live page found the stub still defined, with an empty queue. The earlier state cannot be recreated without undoing the pause, so there is no before-and-after count to quote.
Anyone can repeat the check without logging in. Tag Manager serves each container as a script at googletagmanager.com/gtm.js with the container ID as a parameter. In that file for this store, the count of active Universal Analytics tags was zero, and the 23 paused ones appeared as small entries marked paused with the original type ua. A paused tag still ships, as a stub, which leads to the next question.
Why pause the tags instead of deleting them?
Pausing keeps the tag and its triggers and only stops it firing, so it is easy to undo: Google's documentation says a pause needs a saved and published version, and unpausing works the same way[4]. Selecting many tags and pausing them at once is also supported[5]. For a container you did not build, that is the safer first step: the change is one version, you can name it, and rolling back is a bulk unpause and one publish.
Pausing has two costs. First, pausing does not remove every trace of a tag from the delivered script: the store's container still carried 23 inert entries for its paused tags. Second, a paused tag can sit there for years. Once the console has been clean for a while and nobody needs the tags, delete them in a second version.
Do not disconnect the Google & YouTube channel to get rid of the container. That channel is also what Shopify uses to set up GA4 tags[6], so removing it can take working measurement with it. If the legacy container is the only problem, pause the tags inside it.
How do you check that the pause worked?
- Reload the page and check the console for the stub message. Type ga.q: it should not exist, or be empty. Typing ga should still show a function.
- Fetch the container script for the ID you changed and count the tags of type ua that are still active. After a full pause the count is zero, and the paused ones show as paused.
- Open GA4's real-time report or its debug view while you browse the store, and confirm that the page views and events you expect still arrive. The pause should change nothing there.
If something you needed stops, unpause the tags, publish, and check again. Keep the version name plain, such as "Pause legacy Universal Analytics tags", so a colleague can find it.
What does pausing not fix?
It removes one kind of console noise and one source of dead tracking. It does not prove that GA4 is counting correctly: a clean console says nothing about whether each page view is counted once. Other messages in the console, from apps and from the theme, are separate problems with separate causes. Treat the stub message as a finished item and check GA4 on its own.
References
Numbers in square brackets in the text link to these sources.
- Shopify Help Center: Pixel migration (opens in a new tab).Used for: the stub's migration link, converted Google tags and the advice to remove old code.
- Google Analytics Help: Universal Analytics has been replaced by Google Analytics 4 (opens in a new tab).Used for: when Universal Analytics stopped processing and access ended.
- Omnibug on Firefox Add-ons (opens in a new tab).Used for: a free extension that decodes analytics requests into readable form.
- Google Tag Manager Help: Pause tags (opens in a new tab).Used for: what pausing does, that it needs publishing, and how to unpause.
- Google Tag Manager Help: Bulk actions (opens in a new tab).Used for: pausing or unpausing several tags at once from the list.
- Shopify Help Center: Set up Google Analytics 4 (opens in a new tab).Used for: the Google & YouTube channel being the way to set up GA4 tags.