Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Analytics or Search Console tag lost in migration: fix it

SEO-306Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Two small pieces of code tie your site to Google's tools. The analytics tag (a GA4 gtag.js snippet or a Google Tag Manager container) sends visit data to your reports. The Search Console verification proves you own the site. It is usually a <meta name="google-site-verification"> tag in the page head, an HTML file in the root, a DNS TXT record, or your analytics or Tag Manager code.

In a migration or redesign these are often stored in the old theme's header file, a plugin you no longer use, or a custom code box that was not copied across. The new site goes live looking perfect, but the tags are gone.

Why it costs you leads or sales

Without the analytics tag, you stop seeing traffic, sources and conversions. Ad platforms and reports that depend on GA4 go quiet, so you cannot tell if the launch helped or hurt. You find out weeks later, with a gap in your history that cannot be backfilled.

Without Search Console verification, Google can eventually remove your access. You then lose the data you need after a migration: indexing errors, crawl problems, ranking drops and sitemap status. Problems that would have been caught in days stay hidden.

How a lost tag hides a bigger problem
  1. Site relaunchedNew theme or platform goes live
  2. Tags not copiedGA4 and verification tag stay in the old theme
  3. Data stopsNo visits or conversions recorded
  4. Issues unseenIndexing and ranking problems go unnoticed

The visible site works, but measurement and search diagnostics stop.

Sessions recorded in GA4 around a launchExample numbers
Sessions recorded in GA4 around a launch (example)Day before launch: 420 sessions per day; Launch day: 0 sessions per day; Day after: 0 sessions per day; After fix: 415 sessions per day016132242000415Day before launchLaunch dayDay afterAfter fixsessions per day

Example: traffic is steady, but reported sessions drop to zero on launch day because the tag is missing.

How to check if your site has it

Check both tags in a few minutes
  1. View the live page source

    Open your homepage in a browser, right-click and choose View page source. Search (Ctrl+F or Cmd+F) for google-site-verification, gtag/js?id=G- and googletagmanager.com/gtm.js.

  2. Compare with the old site

    If you still have the old theme or a staging copy, search its source for the same strings and note the exact IDs (G-XXXXXXX, GTM-XXXXXXX and the verification token).

  3. Check GA4 Realtime

    In GA4 go to Reports > Realtime, then visit your site in another tab. If your visit does not appear, the tag is missing, wrong or blocked.

  4. Check Search Console ownership

    In Search Console open Settings > Users and permissions. Then open Settings > Ownership verification to see which method is in use and whether it still passes.

  5. Confirm the property matches

    If the domain, protocol (http or https) or www changed, the old property may not cover the new URLs. Add a new property or use a Domain property with DNS verification.

How to fix it

Put each tag back using the method that suits your platform, then re-verify. Where you can, use a method that does not depend on the theme, such as a DNS TXT record for Search Console and a Tag Manager container for analytics.

Restore the tags by platform
  1. Use a plugin or header field, not the theme file

    Add the GA4 snippet and verification meta tag with a header and footer scripts plugin, or the SEO plugin's webmaster tools field (for example in Yoast SEO or Rank Math settings). This keeps them when you change themes.

  2. Clear caches

    Purge your caching plugin and any CDN so the live source shows the tags.

Example head tags (replace with your own IDs)html
<meta name="google-site-verification" content="YOUR_VERIFICATION_TOKEN" />
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>
Re-verify in Search Console
  1. Open Ownership verification

    In Search Console choose Settings > Ownership verification for your property.

  2. Pick a method that fits

    Use the HTML tag if the tag is back in the head, or DNS record if you control DNS. Copy the token Google shows (it may differ from the old one).

  3. Click Verify

    If it fails, view the live source to check the tag is present exactly as shown, and that caches are cleared.

  4. Add a second method

    Keep a backup method, such as DNS plus the HTML tag, so one lost tag does not remove access.

Tags before and after the fix

After migration

  • GA4 snippet missing from the head
  • Verification meta tag gone
  • Realtime report shows no visits
  • Search Console warns ownership is lost

After the fix

  • GA4 loads on every page
  • Verification via DNS plus meta tag
  • Realtime shows your test visit
  • Search Console shows verified ownership

How to confirm it's fixed

Confirmation checklist
  • The live page source contains your GA4 or GTM ID on the homepage and on a deep page
  • GA4 Realtime shows your own visit within a minute
  • Search Console shows your property as verified under Ownership verification
  • A second verification method is in place
  • Key conversion events still appear in GA4 after a test submission
  • Tags appear on every template, including blog, product and landing pages

How to prevent it happening again

Add the tags to your launch checklist and keep a note of every ID and token in one place. Prefer methods that sit outside the theme: a DNS TXT record for Search Console, and a Tag Manager container for analytics. Before any redesign, list every code snippet in the old head and footer, then confirm each one on the new site before switching DNS.

How it often unfolds
  1. Launch day

    New theme goes live without the old header code.

  2. Day 1-3

    Analytics shows a sudden drop that looks like a traffic crash.

  3. Week 2

    Someone notices Search Console no longer loads for the site.

  4. Fix day

    Tags restored and ownership re-verified.

How FunnelGuard handles this

FunnelGuard detects this only partly. It checks that the tracking tag is present on your pages and firing when its robot visitor runs your journeys. It does not check Search Console verification, so it cannot tell you if your ownership has lapsed or the verification token is missing.

To cover the rest by hand, open Search Console > Settings > Ownership verification after every launch and then once a quarter, and confirm the status still passes. Keep a second method (such as a DNS TXT record) in place. If the tag check does fail in FunnelGuard, one alert goes out after a re-check from a second region, with a screenshot and a likely cause.

You can try it on the Free plan (1 site, 2 journeys, daily checks, no card), or start a 3-day free trial on any paid plan. A free read-only website audit is also available.

Questions people ask

Why is my Google Analytics not tracking after a website migration?

Most often the GA4 snippet lived in the old theme or a plugin and was not copied to the new site. View the live page source and search for your G-XXXXXXXX ID or GTM-XXXXXXX container. If it is missing, add it again and check GA4 Realtime.

Why did Search Console say my site is no longer verified?

The verification meta tag, HTML file or DNS record was probably removed during the redesign or migration. Google re-checks ownership periodically, so access can lapse some time after the change. Re-add a method under Settings > Ownership verification and click Verify.

How do I re-verify Search Console after a redesign?

Open Settings > Ownership verification, pick a method (HTML tag, HTML file, DNS record, GA4 or Tag Manager) and follow the steps. Make sure the code is live before clicking Verify. Add a second method as a backup.

What is the safest way to verify Search Console so it survives a redesign?

Use a Domain property with a DNS TXT record. It does not depend on your theme, plugins or page code, so a redesign cannot remove it. Keeping an HTML tag as well gives you a backup.

Will I lose my Search Console data if verification lapses?

Your historical data is generally kept, but you lose access until you verify again. You also do not collect or see new issues in the meantime, so fix it quickly after a migration.

How do I check if my Google Analytics tag is on my site?

View the page source and search for gtag/js?id=G- or googletagmanager.com/gtm.js. You can also open GA4 Realtime and visit your site in another tab. If your visit does not show, the tag is missing or not firing.

Does FunnelGuard check Search Console verification?

No. FunnelGuard checks that the tracking tag is present and firing on your journeys, but it does not check Search Console verification. Check Ownership verification in Search Console by hand after launches.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: Tag presence checked; GSC verification not.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.