Docs
TCF v2.2 & Google Consent Mode v2
Derive a TC string and Consent Mode signals from the subject's state.
Configure the CMP in the console (TCF configuration) and map each purpose to its tcfPurposeIds. Then ask for the derived string — you do not implement TCF.
TC string
GET /v1/consent/tcstring?subject=email:user@example.com
→ { "tcString": "CQ…", "tcfPolicyVersion": 4, "purposesConsent": [2,7], "cmpId": 300 }The encoder emits the core segment (no vendor section). Enough to gate your own tags from per-purpose consent; per-vendor signalling needs the GVL added.
Consent Mode v2
GET /v1/consent/google-consent-mode?subject=email:user@example.com
→ { "signals": { "ad_storage": "granted", "analytics_storage": "denied",
"ad_user_data": "granted", "security_storage": "granted", … } }The SDK applies it for you: await tc.applyConsentMode(subject, gtag).