On this page
What this issue is
Your consent setup decides which tags may run. It usually has three parts: the banner (from a consent tool or your own code), the Consent Mode defaults (the gtag('consent','default',...) call that sets analytics and ad storage to granted or denied before the visitor chooses), and the mapping between banner categories and tags.
Why it costs you leads or sales
There are two failure modes. If the reset makes everything denied or the banner stops saving choices, GA4, Google Ads, Meta and other tags stop sending conversions. Your reports show a sudden drop and ad platforms lose the signal they use to optimise bidding. If the reset makes everything granted by default, tags fire before consent, which is a compliance risk in regions that require opt-in.
- DeployRelease overwrites the consent config
- Consent defaultsReset to denied, missing or wrong
- TagsGA4 and ad tags blocked
- ConversionsNot reported to ad platforms
The site works, but the tracking chain breaks at the consent step.
Example: real sales stay the same, but reported conversions fall after a deploy resets consent to denied.
How to check if your site has it
Open the site in a private window
Use a fresh session with no stored consent, ideally from the region your visitors are in.
Confirm the banner appears
If it is missing, the banner script or its ID was probably reset.
Check defaults before any click
Open DevTools, go to the Network tab and filter for collect or googleads. Before you choose, analytics hits should be absent or sent in a denied state, depending on your setup.
Accept all and re-check
After accepting, GA4 and your ad tags should send hits. If nothing fires, the mapping or update call is broken.
Reject all and re-check
Marketing tags should stay quiet. If they fire, consent is not being enforced.
Compare with the last release
Check the deploy diff and the consent tool's change log for banner, template or container changes.
// Look for a consent 'default' command in the data layer
window.dataLayer.filter(function (e) {
return e[0] === 'consent';
});How to fix it
First restore the intended settings, then move them somewhere a deploy cannot silently overwrite. The default consent call must run before any Google tag loads.
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'wait_for_update': 500
});
</script>Re-check the consent plugin settings
Open the plugin's settings and confirm banner, categories and Consent Mode options match what you had. Settings live in the database, so a restored backup or a staging push can overwrite them.
Exclude consent options from syncs
If you use a migration or sync tool, exclude the consent plugin's options so staging values do not replace production.
Check Customer privacy settings
In Settings > Customer privacy, confirm the banner and regions are configured as before.
Check the theme after a theme update
Publishing or duplicating a theme can drop custom code. Look in theme.liquid and any app embeds for your consent script.
Compare container versions
Go to Admin > Versions and compare the live version with the previous one. Look at the consent initialization tag and tag consent settings.
Republish the correct version
If an old workspace was published, restore the last good version, then fix and publish from an up-to-date workspace.
Check project custom code
In Site settings > Custom code, confirm the consent default script is still in the head.
Republish
Publish the site after restoring the code so the live version updates.
Put the config in version control
Keep the consent snippet and banner ID in the repo, with the production value set through an environment variable or config file.
Confirm the build includes it
Check the built HTML contains the default consent call above the tag loader.
How to confirm it's fixed
- The banner appears for a new visitor in a private window
- Before choosing, the consent default is denied (or your intended default)
- After Accept, GA4 and ad tag hits appear in the Network tab
- After Reject, marketing tags do not fire
- The choice persists after a page reload
- GA4 Realtime and your ad platform's tag diagnostics show events again
How to prevent it happening again
- Store the consent snippet, banner ID and category mapping in version control
- Keep separate staging and production banner IDs and document them
- Exclude consent plugin options from database syncs and backups restores
- Add a consent test (banner shows, accept fires tags, reject blocks them) to your release checklist
- Use Tag Manager version notes so consent changes are traceable
- Run the same journey checks automatically after each deploy
Day 0, 14:00
Release deploys and replaces the consent config with a default.
Day 0, 14:05
Pages load normally; no error is visible.
Day 2
Reported conversions are far below the usual level (example).
Day 3
Config restored and consent test added to the release checklist.
Consent: blocked / denied
- GA4no hit
- Google Adsno hit
- Meta Pixelno hit
Consent defaults are wrong, so tags are blocked even after a visitor accepts, or fire before any choice.
Toggle to see how a reset changes which tags fire.
How FunnelGuard handles this
FunnelGuard detects this today through its consent contracts check. A robot visitor loads your pages on a schedule from the EU or the US, and checks that consent behaves as you expect and that the tracking hits to platforms such as GA4, Google Ads and Meta are sent when they should be. If a deploy changes that behaviour, the failure is re-checked from a second region and you get one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause.
Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and never bypasses CAPTCHAs or bot protection. 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.
Questions people ask
Why did my analytics stop tracking after a deploy?
A common cause is that the deploy reset your consent configuration, so GA4 and ad tags are blocked by default or never receive the granted signal. Other causes are a removed tag snippet or a changed container. Test in a private window and compare the Network tab before and after accepting consent.
Why is my cookie banner not showing after an update?
The banner script, its ID or its template placement was probably overwritten or removed by the release. Check that the consent tool's script is still in the live page source and that the production ID, not a staging one, is in use.
How do I check that Consent Mode is working?
Open the site in a private window and look in the data layer for a consent default command before any Google tag loads. Then accept and reject in turn and watch the Network tab to confirm tags fire only after the right choice.
Can a Google Tag Manager publish reset consent settings?
Yes. Publishing from an outdated workspace can replace the live container with a version that lacks your consent initialization tag or tag consent settings. Compare versions under Admin > Versions and restore the last good one.
Is it safe to set consent to granted to get tracking back?
Not as a long-term fix. Forcing granted means tags fire without a visitor's choice, which may breach consent rules where you operate. Restore your real configuration instead.
How do I stop deploys overwriting my consent settings?
Keep the consent snippet and banner ID in version control, separate staging and production values, exclude plugin options from database syncs, and add a consent test to every release checklist.
How can I be alerted when consent breaks after a release?
Run an automated check that loads your pages and verifies consent behaviour and tag hits on a schedule. FunnelGuard does this through its consent contracts check and sends one alert with a screenshot and a likely cause.
Related issues
- OPS-293Deploy removed tracking snippetFix guide
- OPS-295Staging config in production (API URLs, test keys)Fix guide
- OPS-299Environment variable missing after redeployFix guide
- OPS-292Deploy broke landing page or formFix guide
- OPS-307Change made without changelog (no root-cause trace)Fix guide
- OPS-308Deploys during peak ad hoursFix guide