Consent Mode Default States, Regions and wait_for_update: Fixing Tag Race Conditions

The Bug That Looks Like a Revenue Problem

A very common Consent Mode failure is not a missing banner but a race condition: Google tags load, read their consent state, and make their first request before the CMP has told them what the visitor chose. The result is hits sent with the wrong state, or consent updates that arrive after the data has already been counted as denied.

The Three Moving Parts

A Safe Default Block

The default command must run before any Google tag loads. A typical pattern sets ad_storage, analytics_storage, ad_user_data and ad_personalization to denied, and adds a short wait_for_update, for example 500 milliseconds. Pick a value long enough for your CMP to load and read stored choices, but short enough that slow loads do not delay measurement too much.

Using the region Parameter

The default command can be limited to specific regions with the region parameter, using ISO 3166 country or subdivision codes. You can issue several default commands: one with denied values for regions where you want opt-in, and a general one for the rest. More specific regions take precedence over broader ones. Keep your region list in one shared snippet so it does not drift between sites.

Return Visitors

The most overlooked case is a visitor who already made a choice. Your CMP must call update as early as possible on page load with the stored values. If the update is slower than your wait_for_update value, the first hit goes out as denied. Measure how long your CMP takes to apply stored consent and set the wait accordingly.

Step-by-Step Test Procedure

  1. Open a clean browser profile with DevTools and the Network tab, preserving logs.
  2. Load the page and find the first request to a Google endpoint. Read its gcs and gcd parameters.
  3. Accept in the banner. Confirm an update is sent and later hits show granted values.
  4. Reload. The very first hit should already carry the stored state.
  5. Repeat with reject, then with a region where your default is granted.
  6. Use Tag Assistant to view the consent state at each event.

Typical Failures and Fixes

How FlexyConsent Helps

FlexyConsent supports Google Consent Mode v2 and is a Google-certified CMP (CMP ID 317). Placing the script high in the head lets it set defaults and send updates in the correct order, and the banner is available in 58 languages.

Key Takeaways

← Blog Read All →