Universal Analytics is dead. Long live the king. Anybody know how to stop Shopify from loading the old UA tracking code alongside the newer GA4 code? Many thanks!
Topic summary
Issue: Shopify continues loading outdated Universal Analytics (UA) tracking code alongside the newer GA4 code, creating duplicate tracking.
Solutions Identified:
- Remove old UA code from Online Store > Preferences under the Google Analytics section
- Inspect and clean theme files via Online Store > Themes > Edit Code, removing any UA references
- Simplest fix: Disconnect Google Ads from Google setup in Shopify, which automatically removes the extra tags
Unresolved Question: Whether deleting the old UA tracking code from theme files will erase historic conversion data in Google Ads remains unanswered, with users seeking clarification on this concern before proceeding with removal.
Hi, @plfunkymusic !
go to Online Store > Preferences. In the “Google Analytics” section, check for the old Universal analytics tracking code and remove it if it’s present. Optionally, add the GA4 tracking code in the same section and save your changes. If needed, inspect your theme files by navigate to Online Store > themes, selecting “edit code” under “actions” for your current theme, and remove any references to the old Universal analytics tracking code in the code editor.Save your theme files after making these adjustments. Additionally clear your browser cache to make sure youre not viewing cached content
Hi @ignelis_1 - i’ve actually just sorted this via an answer way down in another thread.
The solution for me was really simple - i disconnected Google Ads from my Google setup and the additional tags have gone. I guess some changes within Google Ads would also fix this issue.
Thanks again for your answer. Hope this helps folks.
Does deleting the old Universal analytics tracking code in theme.liquid remove historic conversion data from Google Ads?
Bumping this. @Liam any insight here? I have a client who migrated to GA4 by installing the Google app on their store, but their old UA tag is still loading on the site. Will going in and removing the UA tag delete historic conversion data, or am I safe to do so? Analytics is probably my most common pain point in dealing with Shopify for what it’s worth, feels like Shopify changes how they do it every year.