Skip to the content
Start free

A tracking tag is added twice

The same analytics ID or outside script is loaded more than once, which can count every visit and every sale twice.

Medium priority Privacy, cookies and tracking

Why it matters #

When the same Google Analytics ID is on the page twice, for example once from a plugin and once from a pasted snippet, each page view and each purchase can be counted twice. Reports then show more traffic and sales than you really had, and decisions are made on wrong numbers.

A script loaded twice also costs download time and can run its code twice.

How to fix it #

Find where each copy comes from: a plugin, the theme, a tag manager or code pasted into the header. Keep one, usually the tag manager or a single plugin, and remove the rest.

Check again with the Tracking Checker, and compare your analytics numbers for a week before and after the change.

What it looks like, and fixed #

The problem
<!-- Added by an analytics plugin -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<!-- Pasted into the theme header years ago -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>

The same measurement ID loaded twice, so page views and sales can be counted twice.

Fixed
<!-- One Google tag, from one place only -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>

Keep one source, usually the tag manager or a single plugin, and remove the rest.

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 duplicate tracking from [your website address], built with [your platform, e.g. WordPress with Site Kit]. A checker says the same analytics ID or outside script loads more than once on [the page address], which can count every visit and sale twice. First, read the page source (or ask me to paste it) and list every copy of each analytics ID and repeated script, and what most likely adds it. If I use a tag manager, ask me to list its tags and triggers. Explain plainly which events, such as page views and purchases, are counted twice. Then tell me which single source to keep and give me the exact steps to remove the others. Rules: keep exactly one working copy, keep purchase and conversion events firing once, keep the consent settings, back up first, and change nothing else. Tell me how to confirm in the analytics real-time or debug view. Finally, tell me to re-check with the URSY.com Tracking Checker at ursy.com/tracking-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

Check analytics plugins, header and footer code plugins, theme options and your tag manager. Keep one of them for each tag.

Shopify

Check the Google channel, apps, customer events (pixels) and code pasted into theme.liquid. Remove the copies you do not need.

A hand-made site

Search your templates for the measurement ID and keep one copy in the shared head template.

Check it is fixed #

Run the Tracking Checker again: each analytics ID and outside script should load only once. In the analytics real-time view, one page view should count once.

Questions #

Will my old reports be corrected?

No. Past data stays as it was recorded. Make a note of the date of the fix so you can compare fairly.

Does a tag manager plus a plugin count twice?

If both send page views to the same measurement ID, yes. Keep one of them for that ID.

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