On this page
What this issue is
GA4 is Google Analytics 4, the current version of Google's analytics. It collects data when a small piece of code, the GA4 tag (also called the Google tag or gtag.js), loads on your pages. If the tag is not there, GA4 records nothing.
This issue is the site-wide version of that problem. The tag was working, then you changed the theme, updated it, switched page builder or migrated to a new platform. The code lived in the old theme's header.php, a custom code box or a template, so it disappeared from every page at once.
Why it costs you leads or sales
With no tag, GA4 shows no sessions, no key events and no revenue. You cannot tell which channels bring leads. Google Ads and other tools that import GA4 conversions or audiences also lose their data, so bidding and reporting can drift without anyone noticing.
The damage is also permanent. GA4 cannot backfill days when nothing was collected. Every day the tag stays missing is a gap in your history.
- Theme or builder changeOld header code is no longer used
- GA4 tag on pagesSnippet gone from every page
- GA4 hitsNo page_view or key events sent
- Reports and ad importsFlat lines, missing conversions
The theme change breaks the tag, so everything after it is lost.
Example: a site with steady traffic drops to near zero in GA4 the day after a theme switch, although real visitors keep arriving.
How to check if your site has it
Check GA4 Realtime
Open your site in a private window, then look at Reports > Realtime in GA4. If you do not appear within a minute or so, continue. Ad blockers and consent banners can hide you, so test with them off.
View the page source
On your home page, right-click, choose View page source and search for
googletagmanager.comandG-. Do this on a few different pages.Check the Network tab
Open browser DevTools > Network, reload, and filter by
collectorgtag. A working install shows a request togoogle-analytics.com/g/collect.Use Tag Assistant
Open tagassistant.google.com, enter your URL and see whether a Google tag or GTM container is detected.
Compare with your GA4 data
In GA4, look at Reports > Engagement > Pages and screens by day. A sudden cliff on the date of the change points to this issue.
How to fix it
First find your measurement ID. In GA4 go to Admin > Data streams, open your web stream and copy the ID that starts with G-. Then reinstall the tag in a place that is not tied to the theme.
Use a plugin, not theme files
Install a tag plugin such as Site Kit by Google, or a header and footer scripts plugin, and add your G-ID there. Plugins survive theme switches.
Check for duplicates
If a plugin or the new theme already adds GA4, do not add it twice. Pick one method.
Clear caches
Purge your caching plugin and CDN so the updated header is served.
Use the Google and YouTube channel
In the Shopify admin, add the Google and YouTube sales channel and connect your GA4 property. This is stored in the store, not the theme.
Remove stale theme code
If you pasted gtag code in the old theme's
theme.liquid, it is not carried to the new theme. Do not paste it again if the channel already handles it.
Check the container snippet
The GTM container code in the head and body may be what vanished. Restore it from Admin > Install Google Tag Manager.
Check the GA4 tag
In GTM, confirm a Google tag with your G-ID exists, fires on All Pages, and that the latest version is published.
Add code in project settings
Go to Site settings > Integrations or Custom code > Head code, paste the Google tag and publish. Site-level code is kept across design changes.
Add tracking code per funnel or site
Open the funnel or website settings, find Tracking Code (Head) and paste the Google tag. Do this again for each funnel or site you rebuilt from a template.
Connect Google Analytics
Go to Marketing & SEO > Marketing integrations > Google Analytics and enter your G-ID, or add the tag under Settings > Custom code. Then publish.
Use Code Injection
Open Settings > Developer Tools > Code Injection and paste the Google tag in the Header box. Template changes keep this setting.
Put the tag in the shared layout
Add the snippet inside
<head>of your base layout or template so every page inherits it, and deploy.
<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>How to confirm it's fixed
- Open a private window, visit several pages and see yourself in GA4 Realtime.
- View source on the home page, a landing page and a thank-you page and find your
G-ID. - In DevTools > Network, see a
g/collectrequest on each page load. - Tag Assistant detects the Google tag with the right measurement ID.
- Submit a test form and check that your key event appears in Realtime.
- Check again the next day that sessions are back in standard reports.
How to prevent it happening again
The root cause is storing tracking code inside something you replace. Keep it somewhere that outlives the design.
- Install GA4 through a plugin, GTM or the platform's global setting, not in theme files.
- Add 'verify analytics' to your launch checklist for any theme, builder or migration change.
- Test a staging copy before switching the live theme.
- Set a GA4 custom insight or routine check for sudden traffic drops.
- Keep a note of the measurement ID and where the tag lives.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real customer journeys on a schedule and checks the tracking hits sent to GA4 at each step. If the GA4 hits stop appearing across your journeys after a theme or builder change, the failure is re-checked from a second region, then you get one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial. A free read-only website audit is also available.
Questions people ask
Why did GA4 stop tracking after I changed my theme?
The GA4 snippet was most likely stored in the old theme's header file or settings. A new theme does not carry that code over, so no page loads the tag and GA4 receives nothing. Reinstall it through a plugin, Google Tag Manager or the platform's global setting.
How do I check if my GA4 tag is still on my website?
View the page source and search for googletagmanager.com and your G- measurement ID, or open DevTools > Network and look for a g/collect request. You can also run your URL through Google Tag Assistant and check GA4 Realtime.
Will I lose GA4 data while the tag was missing?
Yes. GA4 only records visits while the tag is loading, and it cannot backfill the gap. Fix it quickly to limit the missing days, and note the gap in your reports.
Where should I put the GA4 tag so a theme change does not remove it?
Use something independent of the theme: a plugin such as Site Kit on WordPress, Google Tag Manager, the Shopify Google and YouTube channel, or the global code injection or integration settings in Webflow, Wix and Squarespace.
Why does GA4 Realtime show no users even though the tag is installed?
Common causes are an ad blocker, a consent banner blocking analytics, a wrong measurement ID, or a cached page without the new code. Test in a private window with blockers off, and purge your cache.
How do I find my GA4 measurement ID?
In GA4, go to Admin > Data streams, open your web stream and copy the ID at the top right. It starts with G-.
Can I get alerted if GA4 disappears from my site again?
Yes. FunnelGuard runs your journeys on a schedule and checks that GA4 hits are sent. If they stop, it re-checks from a second region and sends one alert with a screenshot and a likely cause.
Related issues
- TRK-001GA4 tag missing from a funnel pageFix guide
- TRK-003Wrong GA4 measurement ID (staging or another client's property)Fix guide
- TRK-004Old Universal Analytics (UA-) tag still installed, GA4 absentFix guide
- TRK-006GA4 installed twice (gtag.js and GTM) causing double page_viewsFix guide
- TRK-008gtag.js loaded but config command never calledFix guide
- TRK-012GA4 missing on thank-you or order confirmation pageFix guide