Shopify themes, liquid, logos, and UX
Hi,
Google tag assistant tells me:
"Multiple installations of Global site tag (gtag.js) detected",
Basically I have 2 identical Google ads (gtag.js) AW- tags installed on my site.
But looking in the source code I can only find one.
How can I locate and remove the second one?
Thanks!
You may have two entries on your store, do you have your Google Analytics code in Online Store-->Preferences-->Google Analytics? That's the easiest place to install it, but in the older times you had to pop the gtag script into your theme's header code.
To find that you might need to dig around your Theme's source code to see if there is an entry, try looking under Themes--> Live Theme-->Actions-->Edit Code then search for 'header', you should see a 'header--default.liquid' (can vary depending on theme) and you may find your rogue Google Tag in there. Per Add gtag script @ Google you are looking for something along the lines of:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
Remember to duplicate your theme if your not comfy editing code things. Hope that helps. 🙂
Tank you for the reply.
We have installed the tag in the theme.liquid file. But I can only find 1 there, not 2.
I have searched for my Google ID, "gtag", etc. but I can not find any other implementation than the one I did.
Have you checked in the Online Store-->Preferences as well? (see pic) If you have an analytics code there, Shopify will load a second gtag through their dynamic loader so you won't find it in the source.
You may have a tag here
If you have an entry here you should not need the one in your theme.liquid as the Shopify implementation does everything for you.
Hi @Sandra80
Can you share site URL and password (by DM if you prefer) and we can try and track down where they're being fired from?
Are the Analytics account ID's the same?
Do you use Criteo? I've seen this before where Criteo was injecting their own Analytics onto the page.
No, not using Criteo, the tag is Google ads, not Analytics.
Analytics works fine, but Google ads tag is double (AW-XXXXX)
If you PM me the domain I'll be happy to have a look.
The tag is not Analytics, but Google ads.
Analytics tag is fine, but Google ads tag is showing 2 times.
See screenshot please 🙂
Ah, double ad tags, that's weird. Do you by chance use Google Tag Manager? If you have the ads tag in there, plus an older ads tag that would give you two entries?
Tag Manager has the following script that might likely in your theme.liquid from your previous reply.
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-xxxxxx');</script>
<!-- End Google Tag Manager -->
This would load your ad tracking twice, you would never see the second gtag.js as it is loaded externally to your site by google.
Thank you, we have the GTM installed but the container is empty.
That is a weird one. I'm can't think of anything else to suggest on this aside from maybe removing the empty tag manager temporarily see if that helps.
I did that but it didnt help. Also tag assistant doesnt detect the GTM either way.
Did you ever find a solution to this? I'm experiencing the same issue, with multiple GTM tags on the website, but I cannot find them anywhere in the code. We are using the Google & YouTube app which is connected to all accounts, and in the theme.liquid file, I can see the correct G- code to match our Google Analytics. But cannot for the life of me find the GTM tags hidden anywhere, despite them flagging as errors on the Google Tag Assistant Legacy tool
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025