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:
- Temporarily switch your theme to a default WordPress theme (like Twenty Twenty-Four).
- Deactivate all other plugins.
- Check if the tracking code now appears.
- 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:
- View Page Source: Right-click on your website frontend and select "View Page Source." Search (Ctrl+F) for your tracking ID (e.g.,
G-orUA-). You should find it in the<head>or<footer>. - 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.
- 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
-
Google Adshttps://wordpress.org/support/topic/google-ads-25/
-
GA only showing 2 out of 5 pageshttps://wordpress.org/support/topic/ga-only-showing-2-out-of-5-pages/
-
ReferenceError: Can’t find variable: gaoo_datahttps://wordpress.org/support/topic/referenceerror-cant-find-variable-gaoo_data/
-
Data showing inconsistently in newest versionhttps://wordpress.org/support/topic/data-showing-inconsistently-in-newest-version/
-
My website is not being tracked by Google Analytics :(https://wordpress.org/support/topic/my-website-is-not-being-tracked-by-google-analytics-2/
-
Your tracking code begins with GTM- (for Google Tag Manager)…https://wordpress.org/support/topic/your-tracking-code-begins-with-gtm-for-google-tag-manager/
-
Google Analytics statistics no longer workhttps://wordpress.org/support/topic/google-analytics-statistics-no-longer-work/
-
); in first linehttps://wordpress.org/support/topic/in-first-line/
-
GA code isn’t showing. up in the page source, seems like not working.https://wordpress.org/support/topic/ga-code-isnt-showing-up-in-the-page-source-seems-like-not-working/
-
Plugin not workinghttps://wordpress.org/support/topic/plugin-not-working-764/
-
Duplicate Analytics page viewshttps://wordpress.org/support/topic/duplicate-analytics-page-views/
-
No data showing on Google Analyticshttps://wordpress.org/support/topic/no-data-showing-on-google-analytics/
-
GA Scripts loading from Google Domainhttps://wordpress.org/support/topic/ga-scripts-loading-from-google-domain/
-
No HTTP response detected/missing analytics.js scripthttps://wordpress.org/support/topic/no-http-response-detected-missing-analytics-js-script-2/
-
Analytics data is not showinghttps://wordpress.org/support/topic/analytics-data-is-not-showing-2/
-
UTM trackinghttps://wordpress.org/support/topic/utm-tracking-5/
-
sameSite Cookie Errorhttps://wordpress.org/support/topic/samesite-cookie-error/
-
GA Realtime not workinghttps://wordpress.org/support/topic/ga-realtime-not-working/
-
Safari?https://wordpress.org/support/topic/safari-12/
-
Google tracking code is not implemented across all browser typeshttps://wordpress.org/support/topic/google-tracking-code-is-not-implemented-across-all-browser-types/
-
Two tags showinghttps://wordpress.org/support/topic/two-tags-showing/
-
The number of real time users is not workinghttps://wordpress.org/support/topic/the-number-of-real-time-users-is-not-working/
-
GA4 and Universal tags showedhttps://wordpress.org/support/topic/ga4-and-universal-tags-showed/
-
Admin Trackinghttps://wordpress.org/support/topic/admin-tracking/
-
Mutisite supported?https://wordpress.org/support/topic/mutisite-supported/
-
Just discovered Google Analytics has never worked.https://wordpress.org/support/topic/just-discovered-google-analytics-has-never-worked/
-
Cannot find gtag.js to deletehttps://wordpress.org/support/topic/cannot-find-gtag-js-to-delete/
-
Analytics code is not workinghttps://wordpress.org/support/topic/analytics-code-is-not-working/
-
GA code not showing uphttps://wordpress.org/support/topic/ga-code-not-showing-up/
-
Im using the gtag method, but site is still loading analytics.jshttps://wordpress.org/support/topic/im-using-the-gtag-method-but-site-is-still-loading-analytics-js/
-
Bad Event Tracking Codehttps://wordpress.org/support/topic/bad-event-tracking-code-6/
-
Not showing traffichttps://wordpress.org/support/topic/not-showing-traffic/
-
GA stream not workinghttps://wordpress.org/support/topic/ga-stream-not-working/
-
); on first line of the sitehttps://wordpress.org/support/topic/on-first-line-of-the-site/
-
No Data Being Sent to GA after Plugin Installhttps://wordpress.org/support/topic/no-data-being-sent-to-ga-after-plugin-install/
-
Code not showing in view-sourcehttps://wordpress.org/support/topic/code-not-showing-in-view-source/
-
ga4 not recording datahttps://wordpress.org/support/topic/ga4-not-recording-data/
-
Duplicate tracking codehttps://wordpress.org/support/topic/duplicate-tracking-code-2/
-
Infinite scrollhttps://wordpress.org/support/topic/infinite-scroll-107/
-
Not workinghttps://wordpress.org/support/topic/not-working-3147/
-
Duplicate tracking issuehttps://wordpress.org/support/topic/duplicate-tracking-issue/
-
No GA script in sourcehttps://wordpress.org/support/topic/no-ga-script-in-source/
-
Not seeing data in Google Analyticshttps://wordpress.org/support/topic/not-seeing-data-in-google-analytics/
-
Bad Event Tracking Codehttps://wordpress.org/support/topic/bad-event-tracking-code-3/
-
tracking code appearing on websitehttps://wordpress.org/support/topic/tracking-code-appearing-on-website/
-
Google Analytics not working after upgradehttps://wordpress.org/support/topic/google-analytics-not-working-after-upgrade/
-
Google analytics not tracking properlyhttps://wordpress.org/support/topic/google-analytics-not-tracking-properly-2/
-
Using Global Site Tag results in JS errorhttps://wordpress.org/support/topic/using-global-site-tag-results-in-js-error/
-
GA “no-results:” in every searchhttps://wordpress.org/support/topic/ga-no-results-in-every-search/
-
My website is not being tracked by Google Analyticshttps://wordpress.org/support/topic/my-website-is-not-being-tracked-by-google-analytics/
-
Analytics tag disapperainghttps://wordpress.org/support/topic/analytics-tag-disapperaing/
-
Google Analytics code isn’t being inserted when it should behttps://wordpress.org/support/topic/google-analytics-code-isnt-being-inserted-when-it-should-be/
-
Multiple previously used codes sent in header responsehttps://wordpress.org/support/topic/multiple-previously-used-codes-sent-in-header-response/
-
Not Trackinghttps://wordpress.org/support/topic/not-tracking-13/
-
Google Analytics showing no visitorshttps://wordpress.org/support/topic/google-analytics-showing-no-visitors/