Skip to the content
Start free

Old Universal Analytics code is still on the page

The page still loads Universal Analytics, which Google stopped processing in July 2023, so it collects nothing useful.

Low priority Privacy, cookies and tracking

Why it matters #

Google stopped processing data in standard Universal Analytics properties on 1 July 2023. The old analytics.js, ga.js or UA- code may still load and set cookies, but the data goes nowhere you can use.

It slows the page a little and may still need to be covered by your cookie consent, for no benefit at all.

How to fix it #

Remove the old code from the theme, a plugin or your tag manager. If you still want Google's analytics, use Google Analytics 4 with a G- measurement ID, set to wait for consent.

Check the page with What Is This Site Built With? and the Tracking Checker.

What it looks like, and fixed #

The problem
<script async src="https://www.google-analytics.com/analytics.js"></script>
<script>
  window.ga = window.ga || function(){(ga.q = ga.q || []).push(arguments)}; ga.l = +new Date;
  ga('create', 'UA-XXXXXXX-1', 'auto');
  ga('send', 'pageview');
</script>

Universal Analytics code. Google stopped processing this data on 1 July 2023.

Fixed
<!-- UA code removed. If you still want Google Analytics, one GA4 tag, set to wait for consent: -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>

GA4 uses a G- measurement ID. Old UA- IDs and analytics.js or ga.js code can go.

Fix it with your AI assistant #

Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.

Your instruction for the AI
Help me remove old analytics code from [your website address], built with [your platform, e.g. WordPress, or Shopify]. A checker says [the page address] still loads Universal Analytics (analytics.js, ga.js or a UA- ID), which Google stopped processing in July 2023. First, read the page source (or ask me to paste it) and list every piece of old code: analytics.js, ga.js, UA- IDs, and gtag config lines with a UA- ID. Tell me what most likely adds each one. Also say whether a GA4 tag (G- ID) is present. Then give me the steps to remove the old code at its source, and if I want Google Analytics and have none, how to add one GA4 tag that waits for consent. Rules: remove only Universal Analytics code, keep any working GA4 tag and other tags, and back up first. Give exact steps or code and where it goes. Finally, tell me to re-check with the URSY.com tool What Is This Site Built With? at ursy.com/tech-stack-checker/.

We find the problems, and help you fix them

  1. Check Run a free tool or the full audit.
  2. Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
  3. Re-check Come back, check again, and watch each fix turn green.

How the AI Fix Pack works, with a sample to download

Fix it on your platform #

WordPress

Look for UA- IDs in analytics plugins, theme options and header code plugins. Remove the old code, and update or replace plugins that still add it.

Shopify

Check theme.liquid and any old Google Analytics field in the online store preferences for UA- code, and remove it.

A hand-made site

Search your templates for analytics.js, ga.js and UA- and remove that code. In Google Tag Manager, remove any Universal Analytics tags.

Check it is fixed #

Run What Is This Site Built With? again: it should no longer find Universal Analytics. The Tracking Checker should show only the tags you mean to keep.

Official source #

Google Analytics Help: Universal Analytics has been replaced by Google Analytics 4

Questions #

Can I still see my old UA reports?

Removing the code from your site does not change what Google holds. Google has been shutting down access to Universal Analytics properties, so export anything you need if it is still available.

Is the old code harmful?

It collects nothing you can use, slows the page a little and may still set cookies that need consent. There is no reason to keep it.

More problems in Privacy, cookies and tracking

See every problem in the library

For AI assistants and developers: Instructions for AI · Developers · How to cite URSY.com