How to Find Duplicate Google Analytics Tracking Codes in WordPress

Do you see duplicate tracking codes on your WordPress site?

ExactMetrics takes care of inserting your Google Analytics tracking code for you. If you have multiple tracking codes installed, this will affect your stats and even render them inaccurate.

Learn how to find duplicate tracking codes within your WordPress site in this guide.

Not sure if you have duplicate trackers on your site? Follow this guide to find out: How to Detect if You Have Google Analytics Installed Multiple Times.

Here are the most typical areas worth searching for extra tracking codes:

  • Your property settings at analytics.google.com.
  • Your theme’s Options page or Settings page.
  • Your theme’s header.php file.
  • A plugin similar to “Insert Headers and Footers.”
  • A competitor Analytics plugin.
If your additional tracking codes are coming from a YouTube, Wistia, or Vimeo video, or an OptinMonster Form, or an iframe which has an off-site form, you don’t need to remove it.

Your Google Analytics Property Settings

Check if you have any Connected Site Tags in the settings of your UA property or GA4 property.

Google Analytics 4

Step 1: Navigate to analytics.google.com, and ensure your GA4 property is selected.

Step 2: Within your data stream at Admin » Data Stream, scroll down to find the Managed connected site tags option.

Step 3: Remove any Connected tags.

Universal Analytics

Step 1: Navigate to analytics.google.com, and ensure your UA property is selected.

Step 2: Go to Admin » Tracking Info » Tracking Code

Step 3: Under the Website Tracking section, click on the Connected Site Tags option.

Step 3: Remove any Connected tags.

Removing the connected tags means no extra measurement IDs or tracking IDs will be inserted into your website by Google.

Your Theme Options or Settings

Most themes have an Options page that allow users to insert header or footer scripts.

While each theme is different, the Theme Options page is always a good place to start your search for duplicate tracking code:

Sometimes a theme may have an additional option meant just for inserting your Google Analytics tracking code, instead of generic scripts:

If you find any Google Analytics within the options of your theme, and you also have ExactMetrics activated and installed, be sure to remove the extra Google Analytics code found in your Theme Options to avoid duplicate tracking.

Your Theme header

Next, it’s best to search the code within your header.php.

In your WordPress dashboard, click into Appearance » Editor » header.php and search for any Google Analytics code:

If you find tracking code here and you’re currently utilizing ExactMetrics, go ahead and remove the duplicate tracking code from within your header.php.

A Plugin That Enables Inputting Header and Footer Scripts

Tracking codes can also be found in a plugin similar to “Insert Headers and Footers”, which give users the ability to insert scripts into the header or footer of your site.

In your WordPress dashboard, click into Settings » Insert Headers and Footers, or look for a similar plugin:

If there is a tracking snippet within the Settings of the plugin and you’re using ExactMetrics to measure your site performance, go ahead and remove the duplicate tracking code from your insert script plugin.

A competitor plugin to ExactMetrics

If you were using a competitor plugin to ExactMetrics to track your site performance, it could be adding your analytics code a second time.

Typically, competitor plugins contain “Google Analytics” in their title or description.

Step 1: In your WordPress dashboard go to Plugins » Installed Plugins.

Step 2: Find and Deactivate any other analytics plugin to avoid duplicate tracking. ExactMetrics takes care of inserting your Google Analytics code.

 

You did it! You learned some of the common places where you might have duplicate tracking codes and learned how to successfully remove them to avoid having multiple trackers.

What’s next? Learn why different stats software such as Jetpack can show different visitor numbers by reading our guide: Why Are Google Analytics Stats Different From Jetpack’s Stats?