CMP waitForUpdate is 0 or missing
Checks whether the CMP tag has a waitForUpdate value configured, ensuring consent-dependent tags pause for the CMP to respond before evaluating.
Summary
- rule_id —
consent-cmp-wait-for-update - purpose — Detect CMP tags where
waitForUpdateis 0 or absent, leaving consent-dependent tags without a timing buffer - effect — Tags fire before the CMP resolves consent, or are blocked permanently on first load
- layer — container
- reversibility — non-destructive
What fires this
The rule is suppressed on public-endpoint scans because public gtm.js compilation transforms tag parameter structures. It evaluates only on JSON container exports. When a CMP tag is detected via detectCMP(), the rule reads rawTag.parameters.waitForUpdate and parses it as an integer. If the value is 0 or the parameter is absent, the rule fires. A value greater than 0 exits cleanly. For well-known external CMPs — OneTrust, Cookiebot, Usercentrics, and similar — that commonly initialize consent via inline scripts before GTM loads, the rule issues a low-severity finding with softened language. The rationale: if consent defaults are already set when GTM starts, waitForUpdate on the GTM tag is not needed.
Why it matters
waitForUpdate tells GTM (Google Tag Manager) how many milliseconds to hold consent-dependent tags before treating the consent state as final. Without this delay — or with it set to 0 — GTM evaluates tag consent immediately on Consent Initialization, before the CMP script loads and signals the user's choice. Tags then either fire without consent (if the default is "granted") or are blocked permanently on the first load (if the default is "denied"). A value of 500–2000ms gives typical CMP scripts time to load and signal consent. Regulatory: GDPR Art. 6 (lawful basis), GDPR Art. 7 (consent).
Before / after
{
"name": "OneTrust Consent",
"type": "consent_init",
"parameters": {
"waitForUpdate": 0
}
}
{
"name": "OneTrust Consent",
"type": "consent_init",
"parameters": {
"waitForUpdate": 500
}
}
Remediation
- Check whether your CMP loads via an inline script in the page
<head>before the GTM snippet. If so, consent is already available when GTM starts andwaitForUpdatemay not be needed. - If the CMP loads only through the GTM tag, open the CMP tag's Consent Initialization settings in GTM.
- Set
waitForUpdateto a value between 500 and 2000 milliseconds. - Confirm the CMP calls
gtag('consent', 'update', {...})within thewaitForUpdatewindow. - Test in GTM Preview mode and verify the consent update fires before other consent-dependent tags.
Metadata
- Severity
- critical
- Tier
- optimization
- Category
- consent
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
- Regulatory
- GDPR Art. 6 (lawful basis), GDPR Art. 7 (consent)
See also
- Consent rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"consent-cmp-wait-for-update","url":"https://example.com"}'
User: Run consent-cmp-wait-for-update on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "consent-cmp-wait-for-update",
"url": "https://example.com"
}
}