Back to Community

Why Your GA Google Analytics Plugin Isn't Showing Tracking Code (And How To Fix It)

Content

One of the most common issues users report with the 'GA Google Analytics – Connect Google Analytics to WordPress' plugin is that the tracking code doesn't appear on their site. This can be incredibly frustrating, as it means Google Analytics won't record any visitor data. Based on community support threads, here are the primary reasons this happens and the steps you can take to resolve it.

Why This Happens

The plugin's sole function is to add the Google Analytics tracking code to your WordPress site's pages. When the code is absent, it's almost always due to one of a few common conflicts or configuration errors. It is not typically a bug in the plugin itself, but rather an issue with how it interacts with your specific WordPress environment.

Common Solutions

1. Clear Your Cache

This is the most frequent culprit. If you are using a caching plugin (e.g., WP Rocket, WP Fastest Cache, W3 Total Cache) or server-level caching, your browser or server might be serving an old, cached version of the page without the tracking code.

  • Fix: Completely clear or purge your website's cache. After clearing, always open your site in a new incognito/private browser window to verify the code is present in the page source.

2. Check the "Disable Tracking for Admin Users" Setting

A powerful feature of the plugin is the ability to exclude logged-in administrators from being tracked. However, if you are testing your site while logged into WordPress, this setting will prevent the tracking code from being output for you to see.

  • Fix: To test, either uncheck this option temporarily or log out of WordPress and view your site in an incognito window. Remember to re-enable the setting after testing if you wish to continue excluding admin traffic.

3. Perform a Conflict Test

Another plugin or your theme could be interfering with the normal operation of the analytics plugin.

  • Fix: Follow a standard troubleshooting procedure:
    1. Temporarily switch your theme to a default WordPress theme (like Twenty Twenty-Four).
    2. Deactivate all other plugins.
    3. Check if the tracking code now appears.
    4. If it does, reactivate your plugins one by one, checking after each, to identify the conflicting software.

4. Verify You Are Not Using a Google Tag Manager ID

The plugin is designed for Google Analytics tracking IDs (which begin with UA- or G-). It does not support Google Tag Manager IDs (which begin with GTM-). Entering a GTM ID will result in an error and no code will be output.

  • Fix: Double-check that you have entered a valid Google Analytics Measurement ID (e.g., G-XXXXXXXXXX) or Universal Analytics property ID (e.g., UA-XXXXXXXXX-X) into the main tracking ID field, not a Tag Manager ID.

5. Avoid Multiple Tracking Scripts

Some users inadvertently add tracking code in multiple places, such as in the plugin's "Custom Code" field, their theme options, or another SEO plugin. Having multiple instances of the tracking code can cause conflicts and errors.

  • Fix: Search your entire site setup for any other places where a Google Analytics code might be inserted and remove duplicates. Use only one method.

How to Confirm the Tracking Code is Working

Never rely on seeing yourself in Google Analytics' real-time report if you are an admin (due to the setting mentioned above). Instead, use these methods:

  1. View Page Source: Right-click on your website frontend and select "View Page Source." Search (Ctrl+F) for your tracking ID (e.g., G- or UA-). You should find it in the <head> or <footer>.
  2. Browser Developer Tools: Open your browser's Developer Tools (F12), go to the "Network" tab, and reload the page. Filter for requests to "www.google-analytics.com" or "www.googletagmanager.com." You should see a successful request.
  3. Google's Own Tools: Use the Google Tag Assistant browser extension to check if the tag is firing correctly.

If you have confirmed the tracking code is being output correctly but you are still not seeing data in your Google Analytics account after 48 hours, the issue lies with Google's data processing, not the WordPress plugin. In this case, you should seek help from the official Google Analytics Help Community.

Related Support Threads Support