Do you have multiple instances of the Google Analytics tracking code installed on your site?
MonsterInsights installs the Google Analytics tracking code on your site, so if you’ve got multiple trackers installed, the other trackers might mess up your numbers.
In this article, we’ll show you the typical places the code may be hiding, so you can find the duplicate Google Analytics tracking codes and remove them to ensure you’re getting the best data.
Need to find out if you have multiple trackers on the same site? Then please see our guide: How to Detect if You Have Google Analytics Installed Multiple Times.
Typically, the other instance of the tracking code is hiding in one of the following places:
- Your Google Analytics property settings.
- Your theme options or settings.
- Your theme header.php.
- Another plugin like “Insert Headers and Footers.”
- A competitor plugin to MonsterInsights.
If your additional tracking codes are due to a YouTube video, Wistia video, Vimeo video, OptinMonster Form, or an iframe for an off-site form, there is no need to remove it.
Your Google Analytics Property Settings
If you have either a UA property or GA4 property, try checking if you have any active Connected Site Tags.
Google Analytics 4
Step 1: Go to analytics.google.com and select your GA4 property
Step 2: Then open a data stream at Admin » Data Streams and click on Manage connected site tags
Step 3: If you see any tags, remove them
Step 1: Go to analytics.google.com and select your UA property
Step 2: Then click into Admin » Tracking Info » Tracking Code
Step 3: Click on Connected Site Tags
Step 4: If you see any tags, remove them
This will prevent Google from inserting extra measurement IDs or tracking IDs into your website.
Your Theme Options or Settings
Themes typically include a theme options page. These theme options pages may include a place to include header and footer scripts to further customize the theme, as well as add tracking like Google Analytics.
Every theme is slightly different, but you’ll first want to check the Theme Options for the Google Analytics code.
The code is typically hidden wherever your theme allows you to input header and footer scripts.
Sometimes it’ll have a spot specifically for Google Analytics:
If you see any code mentioning Googe Analytics there, and you’ve got MonsterInsights installed and activated, be sure to remove the duplicate tracking code.
Your Theme header
The next spot to check is your theme header.php.
Under Appearance » Editor » header.php look for some code mentioning Google Analytics:
If you find it, and you have already enabled MonsterInsights, go ahead and remove this duplicate code.
A Plugin That Enables Inputting Header and Footer Scripts
Plugins such as “Insert Headers and Footers” enable you to add scripts to the <head> section of your site.
In this example, those settings can be found in:
Settings » Insert Headers and Footers.
You might have to look in the admin for a similar plugin.
A competitor plugin to MonsterInsights
If you had previously installed a competitor plugin to MonsterInsights, it might be adding the analytics code a second time. Typically, these plugins contain the word “Google Analytics” in their title or description.
Step 1: You’ll want to find the plugin in Plugins » Installed Plugins.
Step 2: Deactivate plugin that’s adding the second Google Analytics tracking code, since MonsterInsights is taking care of this.
That’s it! Now you know the typical places duplicate Google Analytics tracking codes are hiding so that you can find and remove them. Ever wondered why different stats software such as Jetpack can show different visitor numbers? See our guide: Why Are Google Analytics Stats Different From Jetpack’s Stats?