# Consent and privacy rules: R01, R02, R16, R21

These rules own the container's consent configuration: gates, the default and updates. A PASS here says the configuration matches the decision, not that the site behaves: tracking-audit CON-01 to CON-07 test the three scenarios at runtime, consent-debugging runs the full matrix, and ga4-audit G23 reads what GA4 received. Each can fail while the others pass.

Checked against Google's Tag Manager consent help, consent guide and consent template APIs on 2026-11-01, and the GA4 data redaction help on 2026-11-02; Google's consent mode overview on 2026-11-06. Every "Confirm" step that submits a form, places an order or clicks a banner on a live site follows [runtime-tests.md](runtime-tests.md).

## What counts as a consent gate

A non-Google tag is gated only by one of these:

- The consent setting "Require additional consent for tag to fire" with the right types (ad_storage, ad_user_data and ad_personalization for advertising tags). Google's help says the tag then fires only if every listed type is granted.
- A condition on every firing trigger that compares a consent-state variable with its granted value (equals granted, true, or the marketing category, such as a OneTrust group ID).
- An exception trigger that blocks when a consent-state variable does not equal granted (an allow-list), and that can fire on the same events as every firing trigger (R16).

A consent-state variable is one whose name or definition is about consent: a CMP cookie, a consent data layer key, a CMP global. A user ID cookie is not one, an internal-traffic exception is not a gate, and trigger names are never evidence.

Not gates:

- A consent event trigger such as `cookie_consent_update`. It fires on every choice, including a rejection. Google's Cookiebot setup help pairs it with "Require additional consent": the event gives a tag blocked at page load a second chance after acceptance; the consent setting is the gate.
- A deny-list check: an exception that blocks when the value equals or contains denied, or a firing condition "does not equal denied". It fails open when no choice exists yet (no cookie, a value in the CMP's own format, the first page before the cookie is written).
- A Page View exception on a tag that fires on a custom event. It never evaluates (R16).

## R01 consent-settings

- FAIL P1: a non-Google tag (Custom HTML, custom image, community or in-house template, built-in third-party template) that sends data or loads a vendor, with consent "Not set" or "No additional consent required" and no gate as defined above. Templates count as sending when their `___WEB_PERMISSIONS___` allow `inject_script`, `send_pixel` or `inject_hidden_iframe` to a non-Google host. The message adds the reason the existing control does not count: a deny-list, an unrecognised condition, an exception that cannot reach the triggers, or a consent event trigger.
- WARN P1: the gate exists only as a trigger condition or allow-list exception, only inside Custom HTML (`OptanonActiveGroups`, `Cookiebot.consent` and similar), or only through a template field such as the Meta template's consent field bound to a CMP variable. The vendor script may still load before a choice; confirm the no-choice and reject paths.
- WARN P2: a Google tag with "Require additional consent" or a strict consent exception. That blocks it outright instead of letting its built-in checks adjust it, which is basic mode for that tag. WARN unless decisions.md records basic for it.
- WARN P2: a Google tag held back only by a deny-list exception (fails open, and contradicts advanced mode).
- WARN P2: a Microsoft UET tag (`baut`) whose export does not show its consent options turned off. Microsoft's help says UET reads the Google consent state when "Enable consent updates" is on (the default).
- WARN P2 (key call-conversion): a Google Ads Calls from Website Conversion tag (`awcc`) with no consent requirement. Google's consent mode overview names Google Ads conversion tracking and remarketing as having built-in checks and says support for Phone Call Conversions is pending, so "Require additional consent" is the control for this tag, not basic mode. Once it requires consent or has a granted-only gate, it raises nothing.
- WARN P3: template permissions not in the file; a tag type the script cannot classify (possibly a destination tag); an advertising tag requiring consent types without ad_storage; "Require additional consent" with no types listed.
- WARN P4: a Custom HTML tag with no consent setting in which the script finds no sending. Mark it "No additional consent required" once reviewed.
- WARN P1 (key basic-unblocked, needs `googleConsentMode` basic in the config): Google tags left "Not set" while decisions.md records basic. Built-in checks are advanced mode: they send cookieless requests while consent is denied. Require additional consent on them, or confirm nothing from Google loads before a grant.
- PASS: Google tags (Google tag, GA4 event, Google Ads, Floodlight, Conversion Linker) left "Not set" rely on built-in checks, except `awcc` above, and with no basic decision in the config. This PASS means advanced mode by configuration, so compare it with decisions.md. The script also prints a consent overview: tags not configured versus configured, and the real gate of each configured tag.
- Agent adds: read decisions.md for the consent model per region. If the documented decision is that no banner applies and the privacy owner signed it, record an exceptions entry that cites the signed decision; the findings stay FAIL, marked accepted, and leave the score and status. Never edit a verdict by hand in the report, or it disagrees with the CSV and JSON output. If the container is loaded with a G- or AW- ID (outside the file), non-Google tags do not run at all; report them as "will not run" instead.
- Confirm, three journeys on a fresh profile in Tag Assistant: ignore the banner and browse; reject everything, then trigger the tag's event and any consent event; accept everything. Pass: no vendor request in the first two, one in the third.

## R02 consent-default

- FAIL P1: a tag that sets the default (`gtag('consent', 'default', ...)` or a template calling `setDefaultConsentState`) or loads the CMP fires on any trigger other than Consent Initialization - All Pages. Tags that run before it read no default.
- FAIL P1: a default that leaves out any of ad_storage, analytics_storage, ad_user_data, ad_personalization. An unset signal is not a policy.
- FAIL P2 (key update-missing-signals): a consent update (`gtag('consent', 'update', {...})` in Custom HTML, or `updateConsentState({...})` in template code) that sets ad_storage or analytics_storage but leaves out ad_user_data or ad_personalization, while a default in the container sets the missing signal to denied. Visitors who consent keep it denied, so Google Ads receives no user data for them and remarketing lists and enhanced conversions lose them. A Consent Mode v1 update left next to v2 defaults is the usual cause. The fix maps the marketing category to ad_storage, ad_user_data and ad_personalization.
- WARN P2, same key: the same update when no default in the container denies the missing signals (the default lives in page code, the CMP script or a template whose object the script cannot read). Confirm in Tag Assistant after "accept all".
- WARN P2: a default set in Custom HTML on Consent Initialization (templates are more reliable because gtag commands queue); granted with no region list unless decisions.md records it for every region served; no `wait_for_update` while the CMP loads separately; two tags setting defaults; no default found in the container; a non-consent tag on Consent Initialization.
- WARN P3, never FAIL: Custom HTML calling `gtag('consent', 'update', ...)` on the CMP choice event. The timing is right; propose the CMP's template (`updateConsentState`). Never advise moving an update to Consent Initialization.
- PASS line for CMP templates: defaults, regions, wait, redaction and URL passthrough parameters, to compare with decisions.md. INFO line for `gtag('set', 'ads_data_redaction' | 'url_passthrough', ...)` found in Custom HTML.
- Why: Google's consent guide sets defaults before any command that sends measurement data; the most specific region default wins, and a default without a region applies to everyone else.
- Agent adds, FAIL P1 when found outside the file: two owners (container, page code before the snippet, the Google tag's consent override, the Settings tab) writing different defaults; or the Settings tab's "Manage default consent settings" set to mark data as consented while consent mode is not used and tags load before consent. With consent mode in use Google does not apply that setting, so Yes is a WARN P2: set it to No, because it still blocks the consent mode override (the same rule as ga4-audit G23). The Settings tab's "Set consent mode override" applies only to destination tags in that container.
- Script limits: only object literals written inside the call are read. An update built elsewhere and passed by name is not checked; read it in the code or in Tag Assistant.
- Confirm: Tag Assistant, Consent tab, On-page Default on the first event, each of the four signals, per region served; after "accept all", the Update state shows all four granted. Tag Assistant also reports storage used before the default.

## R16 exception-reach

An exception only blocks a trigger that fires on the same underlying event (practitioner guidance; Google's exception help does not state it). A Custom Event exception matching every event (`.*`) works everywhere.

- FAIL P1: the only consent gate of a sending non-Google tag is an exception that can fire on none of the tag's firing events, for example a Page View exception on a tag that fires on a custom event. R01 also fails the tag.
- FAIL P2: an exception meant to exclude traffic from a conversion (internal traffic, test orders, a hostname) can fire on none of the conversion's firing events, so excluded traffic still converts.
- WARN P3: an exception reaches some firing triggers but not others; an exception that never applies on a non-conversion tag; both sides use regex patterns (or a trigger group), so overlap cannot be proven.
- Event model the script uses: two built-in triggers coincide only when they are the same type; a built-in trigger and a custom event trigger coincide when the custom pattern matches the built-in event name; two custom event triggers coincide when one's exact name passes the other's conditions, or a known event name (container, plan, key and conversion events) passes both. Built-in event names come from Preview, not documentation: gtm.init_consent, gtm.init, gtm.js, gtm.dom, gtm.load, gtm.click, gtm.linkClick, gtm.formSubmit, gtm.historyChange-v2, gtm.timer, gtm.scrollDepth, gtm.elementVisibility, gtm.video, gtm.pageError. Use them only for this test.
- Agent adds: trigger groups are not modelled and are listed under Not checked. The fix is to rebuild the exception as a Custom Event trigger matching `.*` with the same condition, or to move consent into the tag's consent setting.
- Confirm: in Preview, pick the firing event with the exception condition true. Pass: the tag is under Tags Not Fired with the blocking trigger shown, and no request leaves.

## R21 personal-data

- FAIL P1: GA4 event parameters, shared event settings or user properties whose name or source variable looks like personal data (email, phone, first, last or full name, street, address, birth date). `user_id` is R20's job.
- WARN P2: Custom HTML or non-Google templates reading personal-data variables (moved here from R09); a User-Provided Data variable in automatic mode; Meta advanced matching enabled; `{{Page URL}}` sent to a non-Google vendor (query strings can carry emails, order or token parameters).
- WARN P3: a User-Provided Data variable built from CSS selectors, which breaks silently with a redesign.
- PASS: user-provided data sent through the sanctioned route (the Google tag or GA4 event user data setting, Google Ads enhanced conversions, Floodlight enhanced data) from a variable in manual or code mode, with a reminder that Google uses it only under granted ad_user_data.
- Why: Google prohibits personal data in GA4 parameters; user-provided data is the documented route and is governed by ad_user_data.
- Agent adds: name patterns are heuristics. Check values in Preview's Variables tab and data-dictionary.md before rating; except a false match through the exceptions file with the reason.
- Agent adds: the GA4 web stream's data redaction setting (outside the file, [outside-the-file.md](outside-the-file.md) check 7) decides whether emails and listed query parameters in page_location and other parameters reach GA4; GA4 redacts them in the browser before sending. Email redaction off, or token and personal query parameters not listed, keeps a page_location leak open even when the tags are clean.
- Confirm: DebugView or the outgoing request shows no personal values in parameters; for user-provided data, the request carries hashed fields only under granted ad_user_data.

## Settings tab fields that decide consent (outside the file)

- "Set consent mode override": denied defaults for chosen regions, destination tags only.
- "Manage default consent settings": whether data sent to Google is treated as post-consent.
- Central settings do not apply to data a Google tag in the container sends. Read them in the UI or ask the owner ([../assets/evidence-request.md](../assets/evidence-request.md)); labels change, so quote what the screen shows.
