On this page
What this issue is
Many WordPress sites load tracking through a plugin: an analytics plugin, a tag manager plugin, a Meta pixel plugin, a theme option, or a plugin that injects code into the header and footer. When that plugin updates, the new version can behave differently from the old one.
Common ways the snippet disappears: the update resets or migrates settings and loses your ID, the plugin moves the snippet to a new hook that your theme does not call, a new consent or privacy option defaults to blocking scripts, the plugin is deactivated after a failed update, or a caching or optimisation plugin keeps serving the old HTML or delays and strips the script.
Why it costs you leads or sales
Without the snippet, GA4 records no sessions, and ad platforms receive no conversions. Smart bidding in Google Ads and Meta optimises on conversion data, so it starts working from stale or empty signals. Retargeting audiences stop filling. Reports show a drop that looks like a traffic problem when it is a measurement problem.
- Plugin auto-updatesNew version changes settings or hooks
- Snippet removedTag ID no longer printed in the page
- Page views not sentGA4 and ad pixels stay silent
- Conversions not sentLeads and purchases not attributed
- Ad bidding starvesPlatforms optimise on missing data
The visitor journey still works, but every step after the update is unmeasured.
Example: illustrative numbers. Real leads keep arriving, but reported conversions drop to zero after the update.
How to check if your site has it
Check what updatedWordPress
In WordPress go to Dashboard > Updates, or Plugins > Installed Plugins, and look at which tracking, header, cache or consent plugins changed recently. Many hosts also keep an update log.
View the page source
Open your homepage in a private window, right-click and choose View page source, then search (Ctrl+F or Cmd+F) for your tag ID, such as G-XXXXXXX, GTM-XXXXXXX or the Meta pixel ID. Do this on a key landing page too.
Use a tag debugger
Use Google Tag Assistant for GTM and GA4, or the Meta Pixel Helper browser extension. Check that the tag loads and fires on page view.
Check the network tab
In browser DevTools open Network, reload, and filter for collect, gtm.js, gtag or fbevents. No request means the tag is not running.
Compare reports
In GA4 open Reports > Realtime while you browse your site. If your visit does not appear, tracking is off. Also look for a sudden drop starting on the update date.
Rule out consent and caching
Test with consent accepted. Purge your cache and test again, to see whether the snippet is missing or only blocked or stale.
console.log({
gtm: !!(window.google_tag_manager),
gtag: typeof window.gtag === 'function',
dataLayer: Array.isArray(window.dataLayer) ? window.dataLayer.length : 0,
metaPixel: typeof window.fbq === 'function'
});How to fix it
The fix depends on how the snippet was installed. First find out which plugin was responsible, then restore the snippet in a way that survives updates.
Identify the plugin that printed the snippetWordPress
Check the plugins that changed. Open each one's settings and look for an empty tracking ID, a disabled toggle or a new 'load scripts' option.
Re-enter the ID and saveWordPress
Paste your GA4 measurement ID, GTM container ID or pixel ID back into the plugin and save. Check any new options for placement (header or footer) and for consent behaviour.
Reactivate or roll back if neededWordPress
If the plugin was deactivated, reactivate it and read the error. If the new version is broken, roll back to the previous version (a rollback plugin or your host's backup) and report the bug to the plugin author.
Purge every cache
Clear the page cache, the optimisation plugin's cache (including minified and combined JavaScript), your host cache and any CDN cache. Also exclude your tag script from delay or defer options if it stopped firing.
Check the theme still calls the hooksWordPress
Plugins that print code rely on wp_head and wp_footer. If you changed or updated the theme, confirm header.php calls wp_head() and footer.php calls wp_footer().
Re-test a real conversion
Submit a test lead or run a test order and confirm the event arrives in GA4 DebugView, Tag Assistant or Meta Events Manager Test Events.
Use one place for tracking
Pick a single method, for example one tag manager plugin or one header-scripts plugin, and do not duplicate the tag in the theme or other plugins. Duplicates cause double counting after a partial restore.
Prefer a small must-use plugin for critical tags
A custom plugin or code in a child theme is not touched by tracking plugin updates. See the code example below.
Keep only the container in WordPress
Install the GTM container snippet once, then manage GA4, Google Ads and Meta tags inside GTM. A plugin update then only risks one snippet, not many.
Confirm the container is published
In GTM check Workspace > Submit, and Versions to see the live version. An unpublished container loads but fires nothing.
Add the snippet in a child theme
Add it to functions.php of a child theme using wp_head so a parent theme update does not remove it.
Version-control the change
Keep the snippet in your repository or deployment so it cannot be lost by a settings reset.
<?php
// functions.php of a child theme
add_action( 'wp_head', function () {
if ( is_admin() ) { return; }
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager -->
<?php
}, 1 );After the update
- No tag ID in the page source
- GA4 Realtime shows nothing
- Ad platforms report zero conversions
- Nobody was told
Fixed
- Tag ID present in the head of every page
- Realtime shows your test visit
- Test lead appears as a conversion
- Snippet kept in one update-safe place
How to confirm it's fixed
- View source on the homepage and a landing page shows your tag IDs once each
- Tag Assistant or Pixel Helper shows the tags firing on page view
- GA4 Realtime or DebugView shows your visit
- A test form submit or test order reaches GA4 and each ad platform
- Google Ads and Meta show the conversion as recent, allowing for their reporting delay
- Test with a logged-out private window and with consent accepted
- Caches have been purged and the page still shows the tag
How to prevent it happening again
- Update plugins on a staging copy first, and test a conversion before you push live
- Turn off auto-updates for the plugin that prints your tracking, or review its changelog before updating
- Keep tracking in one place, ideally a single GTM container
- Take a backup or snapshot before updates so you can roll back
- Keep a note of your tag IDs outside WordPress so you can re-enter them quickly
- Add a post-update check: view source for tag IDs and fire one test conversion
- Set up an automatic check that runs after hours, so a silent change is caught within a day
Day 0
Auto-update runs overnight and the plugin loses its tracking setting.
Day 1
Reports dip, but it looks like a quiet day.
Day 4
Ad platforms warn about low conversion data, or a client asks why numbers fell.
Day 5
You find the missing snippet and restore it. Days of data are gone for good.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real customer journeys on a schedule, and on each step it checks the tracking hits sent to GA4, Google Ads, Meta, TikTok, LinkedIn, Bing, Pinterest, Snapchat, X and Reddit. If a tag that used to fire stops firing after an update, the check fails.
Questions people ask
Why did my Google Analytics stop tracking after a WordPress plugin update?
The update most likely reset the plugin's settings, changed where it prints the snippet, or left the plugin deactivated. A cache can also keep serving old HTML. View the page source and search for your G- or GTM- ID to see whether the code is missing or just not firing.
How do I check if my tracking code is still on my WordPress site?
Open a page in a private window, view the page source and search for your tag ID. Then confirm it fires with Google Tag Assistant or Meta Pixel Helper, and check GA4 Realtime while you browse.
Why is my Meta Pixel not firing after updating WordPress?
The pixel plugin may have lost its pixel ID, moved its script, or been blocked by a new consent setting or a script-delay option in an optimisation plugin. Re-enter the ID, clear caches, then test with Pixel Helper and Events Manager Test Events.
How do I stop WordPress updates from removing my tracking code?
Keep the snippet in one update-safe place, such as a GTM container added through a child theme or a dedicated header-scripts plugin. Test updates on staging, take backups, and run a conversion test after each update.
Can a caching plugin make my tracking code disappear?
Yes. A cache can serve an old version of the page, and optimisation settings that minify, combine, delay or defer JavaScript can stop a tag from loading. Purge all caches and exclude your tracking script from delay options if needed.
Will I get back the data I lost while tracking was off?
Usually not. GA4 and ad platforms only record what the snippet sends at the time, so the gap stays. Fix it quickly and annotate the gap in your reports so it is not misread.
How can I be alerted when a plugin update breaks tracking?
Use a synthetic monitor that runs your journeys on a schedule and checks that tracking hits are sent. FunnelGuard does this and, when it detects a WordPress plugin as the likely cause, includes that in the alert.
Related issues
- TRK-398Page builder (Elementor/Webflow) custom code not publishedFix guide
- TRK-400Tracking only in site header, funnel pages use blank templateFix guide
- TRK-399ClickFunnels/GHL funnel step missing tracking codeFix guide
- TRK-391Next.js/React hydration error stops tagsFix guide
- TRK-404Service worker caches old page with old tagsFix guide
- TRK-389SPA route change sends no page_viewFix guide