How to Check Your Site for Your Google Analytics Tracking Code

After installing MonsterInsights and authenticating it with Google Analytics, you may want to ensure that your tracking code is added to your site properly. To verify that Google Analytics can track your traffic, you’ll need to look at the source code of your website. In this article, we’ll show you how to do it.

Before we get started, you’ll either need to log out of your site or use incognito mode/private browsing mode. This is because, by default, MonsterInsights doesn’t track logged in users to ensure site owners do not skew their own Google Analytics data.

Viewing the Source Code

The best method to check your site for your tracking code is to view the source code of your site and look for the MonsterInsights tag.

Before proceeding, please complete the following:

  1. Clear all caches running on your website
  2. If using plugins that optimize website performance, please exclude MonsterInsights files and scripts from being affected.

Example: If using WP Rocket, we typically recommend adding the following to Settings » WP Rocket » File Optimization to be excluded from file optimizations.

/google-analytics-for-wordpress/assets/js/*.js
/google-analytics-premium/assets/js/*.js
www.googletagmanager.com

This allows MonsterInsights and Google Analytics to load right away on your website and will help make sure your Analytics are as accurate as possible.

Now, navigate to your website in your browser.

Then, you can use a keyboard shortcut to view the source code of your site. If you’re on Windows or Linux, press Ctrl + U to view the source code. If you’re on Mac, press Command + U.

Alternatively, you can right click anywhere on the page and click the View page source option. The wording may be slightly different depending on your web browser.

While viewing your website’s source, search for “MonsterInsights” code:

Below the text “This site uses the Google Analytics by MonsterInsights plugin” will be your tracking code.

Understanding Different Types of Tracking Codes

While viewing this section of code, you’ll be able to see if you’re tracking into your Google Analytics property. Look for your measurement ID which starts with G-.

If you’re using the Ads Addon or PPC Tracking Addon for conversion tracking, you can look for your Google Ads conversion ID which starts with AW-.

Checking for Duplicate Tracking Codes

Make sure your measurement ID and conversion ID (if applicable) only appears once in your website’s source code. If any of these tracking codes appear more than once, then your tracking may not work as expected.

See our guide on removing other Google Analytics tracking codes for more details.