Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Analytics consent config reset by a deploy: how to fix it

OPS-304High impactDetectedBy FunnelGuardPublished Updated
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.

How a deploy breaks consent tracking
  1. DeployRelease overwrites the consent config
  2. Consent defaultsReset to denied, missing or wrong
  3. TagsGA4 and ad tags blocked
  4. ConversionsNot reported to ad platforms

The site works, but the tracking chain breaks at the consent step.

Conversions reported before and after the resetExample numbers
Conversions reported before and after the reset (example)Before deploy: 40 conversions per day; Day after deploy: 6 conversions per day; After fix: 39 conversions per day0153140639Before deployDay after deployAfter fixconversions per day

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

Manual check in a private window
  1. Open the site in a private window

    Use a fresh session with no stored consent, ideally from the region your visitors are in.

  2. Confirm the banner appears

    If it is missing, the banner script or its ID was probably reset.

  3. 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.

  4. 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.

  5. Reject all and re-check

    Marketing tags should stay quiet. If they fire, consent is not being enforced.

  6. Compare with the last release

    Check the deploy diff and the consent tool's change log for banner, template or container changes.

Console check for the consent defaultjavascript
// 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.

Consent Mode defaults, placed before the Google taghtml
<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>
Restore consent settings by platform
  1. 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.

  2. 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.

How to confirm it's fixed

Verification
  • 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

Prevention
  • 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
How an unnoticed reset unfolds
  1. Day 0, 14:00

    Release deploys and replaces the consent config with a default.

  2. Day 0, 14:05

    Pages load normally; no error is visible.

  3. Day 2

    Reported conversions are far below the usual level (example).

  4. Day 3

    Config restored and consent test added to the release checklist.

Consent reset vs intactInteractive
Deploy reset the consent config

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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Consent contracts.

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.