IAB TCF
The IAB Europe Transparency and Consent Framework (TCF) lets Consent Management Platforms (CMPs) record a user's transparency and consent choices in a TC String that vendors in the ad supply chain read. IAB Tech Lab publishes the technical specifications on GitHub; this skill quotes the TCF v2 "Consent string and vendor list formats" and "CMP API" documents.
Scope. The TCF Policies from IAB Europe (purposes, legal bases, CMP and vendor obligations) are a separate legal document and are not pinned here; the quotes are the technical specifications only.
Follow the workflow below step by step. Every rule here comes from a source in Sources. Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: CMP creating TC Strings and providing
__tcfapi, publisher loading a CMP, or vendor reading TC Strings and the Global Vendor List.
- Target version: TCF 2.2 (current). See
references/versions.md.
- Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill, re-read every URL in Sources and check the publisher for a newer revision or version line.
Invariants
- Who should create a TC string. "Vendors or any other third-party service providers must neither create nor alter TC Strings."
- When should a TC string be created. "A TC String that contains positive consent signals must not be created before clear affirmative action is taken by a user that unambiguously signifies that user's consent."
- What are publisher restrictions. "Vendors must always respect a restriction signal that disallows them the processing for a specific purpose regardless of whether or not they have declared that purpose to be "flexible"."
- URL-based services. "TC Strings must always be propagated as is, and not modified."
- Managing conflicting string versions. "Post 30 September 2023 a TC String created with a policy version set to smaller than 4 will be deemed invalid."
- TC String Format. "There are 3 distinct TC String segments that are joined together on a "dot" character."
- Accessing and caching the Global Vendor List. "All requests for the GVL must now be server-side."
- How does the CMP provide the API. "The function
__tcfapi must always be a function and cannot be any other type, even if only temporarily on initialization - the API must be able to handle calls at all times."
- addEventListener. "The
addEventListener callback shall be immediately called upon registration with the current TC data, even if the CMP status is loading and the CMP has incomplete TC Data, so that the calling script may have access to its registered listenerId."
- How can scripts on a page determine if there is a CMP present. "Publishers must load the CMP in a parent (or ancestor) of all iframes that may need to establish a GDPR legal basis."
- Requirements for the CMP "stub" API script. "The stub code must be loaded and executed synchronously before any other scripts that depend on the
__tcfapi function to be there - this usually means between the <head></head> tags of the HTML document - in order to ensure that it can be executed before all calls from third parties."
Workflow
- Pick the version. Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.
->
references/versions.md
✓ The target version is recorded, and it is not a legacy line.
- Apply the pinned requirements. Walk the quotes in
references/requirements.md and implement each one that applies to the role.
-> references/requirements.md
✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.
- Upgrade (only when asked). Follow the upgrade section from the source line to the target.
->
references/versions.md
✓ The result cites the target line and no longer depends on a requirement that only the old line stated.
Verify before done
Reference index
references/versions.md: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.
references/requirements.md: quotes taken from the pinned specification, grouped by source. Load for step 2.
Related skills
Install related spec skills by name with npx skills add ScaleDockHQ/scaledock-skills --skill <name>: iab-gpp, gdpr, eprivacy, gpc, http-cookies.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
1---2name: iab-tcf3description: >-4 IAB TCF 2.2: encode and decode Transparency and Consent Framework consent strings. Covers TCF 2.2. Use when encoding a TCF consent string. Triggers: TCF.5license: MIT6metadata:7 source: https://skillmd.com/skills/scaledockhq/iab-tcf8 author: ScaleDockHQ9 version: "1.1.0"10 kind: standard11---1213# IAB TCF1415The IAB Europe Transparency and Consent Framework (TCF) lets Consent Management Platforms (CMPs) record a user's transparency and consent choices in a TC String that vendors in the ad supply chain read. IAB Tech Lab publishes the technical specifications on GitHub; this skill quotes the TCF v2 "Consent string and vendor list formats" and "CMP API" documents.1617**Scope.** The TCF Policies from IAB Europe (purposes, legal bases, CMP and vendor obligations) are a separate legal document and are not pinned here; the quotes are the technical specifications only.1819**Follow the workflow below step by step.** Every rule here comes from a source in [Sources](#sources). Quoted requirements are sentences taken from the pinned text, labelled with the section they come from. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.2021## Inputs (fill in, or ask before starting)2223- Role: CMP creating TC Strings and providing `__tcfapi`, publisher loading a CMP, or vendor reading TC Strings and the Global Vendor List.24- Target version: TCF 2.2 (current). See [`references/versions.md`](references/versions.md).25- Revision: the pinned revision in [Sources](#sources), unless the user names another.26- Sources: when refreshing this skill, re-read every URL in [Sources](#sources) and check the publisher for a newer revision or version line.2728## Invariants29301. **Who should create a TC string.** "Vendors or any other third-party service providers must neither create nor alter TC Strings."312. **When should a TC string be created.** "A TC String that contains positive consent signals must not be created before clear affirmative action is taken by a user that unambiguously signifies that user's consent."323. **What are publisher restrictions.** "Vendors must always respect a restriction signal that disallows them the processing for a specific purpose regardless of whether or not they have declared that purpose to be "flexible"."334. **URL-based services.** "TC Strings must always be propagated as is, and not modified."345. **Managing conflicting string versions.** "Post 30 September 2023 a TC String created with a policy version set to smaller than 4 will be deemed invalid."356. **TC String Format.** "There are 3 distinct TC String segments that are joined together on a "dot" character."367. **Accessing and caching the Global Vendor List.** "All requests for the GVL must now be server-side."378. **How does the CMP provide the API.** "The function `__tcfapi` **must always be a function** and cannot be any other type, even if only temporarily on initialization - the API must be able to handle calls at all times."389. **addEventListener.** "The `addEventListener` callback shall be immediately called upon registration with the current TC data, even if the CMP status is `loading` and the CMP has incomplete TC Data, so that the calling script may have access to its registered `listenerId`."3910. **How can scripts on a page determine if there is a CMP present.** "Publishers must load the CMP in a parent (or ancestor) of all iframes that may need to establish a GDPR legal basis."4011. **Requirements for the CMP "stub" API script.** "The stub code must be loaded and executed synchronously before any other scripts that depend on the `__tcfapi` function to be there - this usually means between the `<head></head>` tags of the HTML document - in order to ensure that it can be executed before all calls from third parties."4142## Workflow43441. **Pick the version.** Use the current line unless a named consumer needs a supported one. Do not author a legacy line. Emit a preview only when its posture is build and the user asked for that draft.45 -> [`references/versions.md`](references/versions.md)46 ✓ The target version is recorded, and it is not a legacy line.472. **Apply the pinned requirements.** Walk the quotes in [`references/requirements.md`](references/requirements.md) and implement each one that applies to the role.48 -> [`references/requirements.md`](references/requirements.md)49 ✓ Each applicable quote is either implemented or recorded as out of scope for the role, with the section it came from.503. **Upgrade** (only when asked). Follow the upgrade section from the source line to the target.51 -> [`references/versions.md`](references/versions.md)52 ✓ The result cites the target line and no longer depends on a requirement that only the old line stated.5354## Verify before done5556- [ ] The artifact cites the target line's revision from [Sources](#sources).57- [ ] Every applicable quoted requirement in [`references/requirements.md`](references/requirements.md) holds.58- [ ] A TC String the CMP writes contains the Core and Disclosed Vendors segments and a policy version of at least 4.59- [ ] Nothing from a preview line is emitted unless its posture is build and the user opted in.6061## Reference index6263- **`references/versions.md`**: every version line, which one to use, and how to upgrade. Load for steps 1 and 3.64- **`references/requirements.md`**: quotes taken from the pinned specification, grouped by source. Load for step 2.6566## Related skills6768Install related spec skills by name with `npx skills add ScaleDockHQ/scaledock-skills --skill <name>`: `iab-gpp`, `gdpr`, `eprivacy`, `gpc`, `http-cookies`.6970## Sources7172Status uses the publishing body's own maturity term. Checked is the date the source was last read.7374- [IAB Tech Lab - Consent string and vendor list formats v2](https://raw.githubusercontent.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/703fc2964ba8fe1086b18a3c509c46a48c1aee1c/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md): IAB Tech Lab Final specification, Document revision 2.4 (May 2026), commit 703fc29, 2026-07-28, checked 2026-10-06.75- [IAB Tech Lab - CMP API v2](https://raw.githubusercontent.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/703fc2964ba8fe1086b18a3c509c46a48c1aee1c/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md): IAB Tech Lab Final specification, Version 2.2 (February 2026 update), commit 703fc29, 2026-07-28, checked 2026-10-06.