Skip to main content
Back to Guides
Compliance13 min readBy Armin Zaribaf

TCF for Publishers: Implementing IAB's Transparency & Consent Framework

A practical guide to the IAB Transparency & Consent Framework for publishers: who needs it, what TCF 2.2 changed, the TCF 2.3 and 2.4 updates and their deadlines, and how to stay compliant.

Why TCF Matters to Publishers

If you monetise your site with programmatic advertising, the IAB Europe Transparency & Consent Framework (TCF) is almost certainly part of your compliance stack, whether you chose it deliberately or inherited it through your ad partners. The TCF is the advertising industry’s standardised system for collecting, encoding, and transmitting user consent across the programmatic supply chain, so that hundreds of ad-tech vendors can read a single, interoperable consent signal.

This guide is written for publishers: what the framework requires of you, what changed in TCF 2.2, what the TCF 2.3 and 2.4 updates mean in practice, and the current deadlines. If you want the conceptual foundation first, what a TC String is, what the Global Vendor List does, read what is TCF and what a CMP is, then return here for the publisher-specific detail.

How the Framework Works, Briefly

The TCF connects three roles. Publishers run a registered Consent Management Platform (CMP) that shows the consent UI and records the user’s choices. The CMP encodes those choices into a compact TC String and exposes it through a standard JavaScript interface (__tcfapi). Vendors registered on the Global Vendor List (GVL), the public registry of ad-tech companies and the purposes they process data for, read that string to decide whether they have a legal basis to operate.

For you as a publisher, the practical upshot is that your CMP is the single point that determines whether your ad stack can legally personalise and measure. Get the CMP configuration right and the rest of the chain receives a clean signal; get it wrong and you risk either lost revenue (vendors withholding bids) or compliance exposure.

Do You Need TCF?

Your situationTCF needed?
Monetising with Google AdSense or Ad Manager in the EEA, the UK or SwitzerlandYes: a Google-certified CMP is required for personalised ads
Working with programmatic SSPs, DSPs, or ad exchangesYes: partners expect a valid TC String
Running only your own first-party ads, no third-party ad-techNo: a standard consent banner is sufficient
E-commerce or SaaS with analytics but no ad monetisationNo: TCF is for the advertising supply chain

What TCF 2.2 Changed

TCF 2.2 was a substantial overhaul aimed at making consent informed and at addressing regulatory criticism of the framework. The changes that matter most to publishers are:

  • Legitimate interest removed for advertising purposes. Vendors can no longer rely on legitimate interest as the legal basis for Purposes 3, 4, 5, and 6, the purposes covering personalised advertising and content profiling. These now require explicit consent. This materially raised the bar: a user who declines can no longer be served personalised ads under a legitimate-interest claim.
  • Vendor count on the first layer. CMPs must disclose the total number of vendors seeking a legal basis directly on the first layer of the consent UI, so users see the scale of data sharing before they decide.
  • Clearer, jargon-free language. Purpose names and descriptions were rewritten in plainer language, with standardised illustrations of how data is used.
  • Vendor transparency. Vendors must declare additional information about their processing, including a dedicated URL describing their legitimate interests, surfaced through the CMP’s secondary layers.
  • Easy withdrawal. Users must be able to re-open the CMP and withdraw consent as easily as they gave it.

What TCF 2.3 Changed

TCF 2.3 (released 19 June 2025, mandatory since 28 February 2026) made the disclosedVendors segment of the TC String mandatory. Previously optional, this segment removes an ambiguity in how vendors interpret legitimate-interest signals: without it, a vendor could not reliably tell "this vendor was not disclosed to the user" apart from "the user objected." TC Strings created after 28 February 2026 without this segment are invalid; strings created before that date without it remain valid.

What TCF 2.4 Changes

TCF 2.4 (specifications published 23 July 2026) adds a standardTexts field in the GVL with standard explanation text for Features, illustrations for each feature, and a renamed Special Feature 2. The web deadline was 23 October 2026; the app/CTV deadline is 23 February 2027. TCF Policies v5.0.b applies. For most publishers using a maintained CMP, the update is handled by your CMP provider.

Publishers frequently conflate the TCF with Google Consent Mode, but they solve different problems and you often need both. The TCF communicates consent to the IAB programmatic ecosystem via the TC String. Google Consent Mode communicates consent to Google’s own tags (Ads, GA4) via consent signals. A CMP that supports both frameworks typically emits them from the same user choice, so a single banner interaction satisfies the IAB supply chain and Google’s tag behaviour simultaneously.

If you run Google tags alongside programmatic demand, make sure your CMP is configured to drive both. See Google Consent Mode v2 for how the Google side works.

Common Publisher Pitfalls

  • Treating advertising purposes as legitimate interest. Post-2.2, Purposes 3-6 need consent. Configurations carried over from older setups may still assume legitimate interest and quietly under-serve consented demand or, worse, over-claim a basis you no longer have.
  • An unmaintained or unregistered CMP. Only CMPs registered with IAB Europe may participate, and they must keep pace with framework versions. An out-of-date CMP is a compliance and revenue risk.
  • Ignoring non-TCF visitors. TCF governs the ad supply chain, but you still owe every visitor a lawful consent experience under GDPR and the ePrivacy Directive. TCF compliance is not a substitute for a sound overall banner, cross-check the GDPR cookie compliance checklist.
  • Poor first-layer design. The framework sets requirements, but consent rates still depend on UX. Apply cookie banner design best practices within the TCF constraints.

TC String Structure

The TC String is a base64url-encoded binary format. Understanding its structure helps when debugging. A TC String contains multiple segments separated by periods (.):

  • Core segment (always present): TCF version, creation/update timestamps, CMP ID and version, consent language, vendor list version, policy version, publisher country code, purpose consents (a 24-bit bitfield), purpose legitimate interests, vendor consents (variable-length bitfield or range encoding), and vendor legitimate interests.
  • DisclosedVendors segment (mandatory since TCF 2.3): lists all vendors the CMP showed to the user, regardless of whether they received consent.
  • PublisherTC segment (optional): carries publisher-specific purpose consents and custom purposes.

The CMP API: __tcfapi

The __tcfapi function is the interface between the CMP and every vendor tag on the page. The API signature is __tcfapi(command, version, callback, parameter). Per the TCF spec, a CMP must define window.__tcfapi before any vendor scripts load. The stub must also create a named iframe called __tcfapiLocator (found via window.frames['__tcfapiLocator']), which cross-domain vendor tags use to locate the CMP via postMessage.

The key commands:

addEventListener

The standard way for vendor tags to integrate with a TCF CMP. It fires on every consent state change, so the tag reacts to both returning visitors and new choices.

__tcfapi('addEventListener', 2, function(tcData, success) {
  if (success && tcData.eventStatus === 'tcloaded') {
    // Returning visitor: consent loaded from storage
    initializeVendorTag(tcData);
  } else if (success && tcData.eventStatus === 'useractioncomplete') {
    // New choice: user just interacted with the banner
    initializeVendorTag(tcData);
  }
});

getTCData

A one-shot read of the current consent state. TCF 2.2 deprecated getTCData for vendor integration; vendors should use addEventListener instead. getTCData remains useful for debugging in the browser console.

// Debugging only: one-shot consent state read
__tcfapi('getTCData', 2, function(tcData, success) {
  if (success) {
    console.log('TC String:', tcData.tcString);
    console.log('Purpose 1 consent:', tcData.purpose.consents[1]);
    console.log('Vendor 755 consent:', tcData.vendor.consents[755]);
    console.log('GDPR applies:', tcData.gdprApplies);
  }
});

ping

A quick check to see if the CMP is loaded and what state it's in. Useful for diagnostics.

__tcfapi('ping', 2, function(data) {
  console.log('CMP loaded:', data.cmpLoaded);
  console.log('CMP status:', data.cmpStatus);    // 'stub' | 'loaded' | 'error'
  console.log('Display status:', data.displayStatus);
  console.log('GDPR applies:', data.gdprApplies);
  console.log('CMP ID:', data.cmpId);             // e.g. 526
});

Publisher Restrictions in Detail

Publisher restrictions let you override a vendor's declared legal basis for specific purposes. Three restriction types:

  • Type 0, not allowed: the vendor cannot process data for this purpose at all, regardless of what they declared in the GVL. Works on any purpose a vendor declares.
  • Type 1, require consent: forces a vendor to obtain consent instead of relying on legitimate interest. Only meaningful where the vendor declared the purpose as flexible (allowing either consent or LI). In practice this applies to Purposes 2, 7, 8, 9, 10, and 11 where the vendor declared flexibility. Purposes 1 and 3 to 6 already require consent, so type 1 has no effect on them.
  • Type 2, require legitimate interest: forces a vendor to rely on legitimate interest instead of consent. Again, only meaningful where the vendor declared the purpose as flexible. Rarely used.

Each restriction is one row per vendor, with a limit of 300 rows per banner. Publishers set restrictions in the dashboard's publisher restrictions editor (under TCF settings), not by editing JSON.

In practice, type 0 (not allowed) is the most useful restriction: it lets you block a vendor from processing data for a specific purpose entirely. Some DPAs, particularly in France and Germany, have taken the position that legitimate interest is not a valid basis for advertising purposes, which TCF 2.2 codified by removing LI from Purposes 3 to 6.

Implementation Walkthrough

Whether you're setting up TCF for the first time or validating an existing setup:

TCF Implementation Steps

1

Choose a registered CMP

Your CMP must be registered with IAB Europe and have an assigned CMP ID. Only registered CMPs generate valid TC Strings. Verify registration on IAB Europe's CMP list.

2

Load the CMP stub first

The __tcfapi stub must be the first script in <head>. If a vendor tag fires before the stub exists, it may assume GDPR doesn't apply (failing open) or that consent was denied (failing closed, costing you ad revenue).

3

Configure your vendor list

Select only the GVL vendors you actually work with. Disclosing all 1,000+ vendors is poor UX and arguably non-compliant under TCF v2.4's transparency requirements.

4

Set purpose legal bases and publisher restrictions

For each purpose, decide whether you accept consent, legitimate interest, or both (where both are allowed). Purposes 1 and 3 to 6 already require consent. For the remaining flexible purposes (2, 7, 8, 9, 10, 11), consider whether type 1 (require consent) restrictions suit your compliance posture. Type 0 (not allowed) restrictions let you block a vendor from a purpose entirely.

5

Configure the consent UI

TCF 2.2+ requires the consent UI to clearly present all purposes and vendors, provide granular per-purpose and per-vendor control, and offer easy withdrawal. The first layer should describe purposes in plain language; the second layer should show the full vendor list.

6

Test TC String generation

After a user makes a choice, verify the TC String is generated correctly. Use IAB's TC String decoder tools to inspect the string. Check that vendor consents, purpose consents, publisher restrictions, and the disclosedVendors segment are all present.

7

Verify vendor integration

Confirm vendor tags call __tcfapi and respect the result. In DevTools, check that ad calls include the gdpr and gdpr_consent parameters.

8

Wire up Google Consent Mode

Configure your CMP to emit both the TC String (for programmatic vendors) and Consent Mode signals (for Google tags). Don't treat them as either/or.

GVL Management

The Global Vendor List (GVL) is a JSON registry published by IAB Europe. The canonical URL is https://vendor-list.consensu.org/v3/vendor-list.json for the latest version. Specific versions are at https://vendor-list.consensu.org/v3/archives/vendor-list-v{version}.json. The GVL updates roughly weekly.

TCF and Google Consent Mode are separate systems. The TC String goes to programmatic vendors through the __tcfapi; Consent Mode signals go to Google's own tags (GA4, Ads, Ad Manager).

CookieBeam's approach: category-based Consent Mode

CookieBeam sends Consent Mode signals from its consent categories, not from TCF purposes. Accept all and Reject all set both the TC String and the Consent Mode signals. A granular Layer 2 TCF choice (per-purpose or per-vendor) writes the TC String but does not change Consent Mode categories. See Google Consent Mode v2 for how the category mapping works, and TCF vs Google Consent Mode v2 for the full comparison.

Google's built-in TCF integration (alternative)

Google tags also have their own built-in TCF integration, enabled by setting window['gtag_enable_tcf_support'] = true before loading any Google tag. With that flag, Google tags read TCF purpose consent directly from __tcfapi and derive Consent Mode signals themselves (per Google's documentation).

If you use CookieBeam's Consent Mode integration and also enable gtag_enable_tcf_support, both will attempt to set the same Consent Mode signals. Which value wins depends on timing and tag configuration. Do not enable both unless you have tested the interaction and confirmed the signals are set the way you expect.

Debugging Toolkit

  • Browser DevTools Console: Run __tcfapi('ping', 2, console.log) and __tcfapi('getTCData', 2, console.log) to inspect live state.
  • IAB TC String decoder: Paste a TC String into a decoder to verify its contents match what you expect.
  • Network tab filtering: Search for gdpr_consent or consent in query parameters to verify the string is being passed in ad calls. In Prebid.js, check bidRequest.gdprConsent.consentString (should contain the TC String) and bidRequest.gdprConsent.gdprApplies (should be true for EEA visitors). In direct ad server calls, look for ?gdpr=1&gdpr_consent= query parameters.
  • Script load order: If vendor tags fire before the CMP stub, you'll see __tcfapi is not defined errors or vendors defaulting to "no consent."

Where CookieBeam Fits

CookieBeam is a registered CMP in IAB Europe's TCF (CMP ID 526), supporting TCF v2.4 on Professional plans and above (web only). CookieBeam is a Google-certified CMP for web. For publishers using Google Ad Manager, AdSense, or AdMob, verify that your CMP setup meets Google's CMP programme requirements separately.

CookieBeam supports Google Consent Mode v2 (basic and advanced), GPP for US traffic, hard script blocking until consent, and server-side consent audit logging.

Publisher TCF Compliance Checklist

  • Use an IAB Europe-registered CMP

    Only registered CMPs may generate valid TC Strings and participate in the framework.

  • Confirm your CMP supports TCF 2.4

    Since 23 October 2026, CMPs must implement v2.4 disclosures on web. The app/CTV deadline is 23 February 2027.

  • Verify Purposes 3-6 use consent (the framework default since v2.2)

    TCF 2.2 removed legitimate interest for Purposes 3 to 6. No vendor in GVL v184 declares LI on these purposes. Use type 0 (not allowed) restrictions to block specific vendors from purposes you don't want them to use.

  • Show the total vendor count on the first layer

    Users must see the scale of data sharing before deciding.

  • Provide an easy, persistent way to withdraw consent

    Re-opening the CMP and changing choices must be as easy as the original consent.

  • Drive both the TC String and Google Consent Mode from one banner

    If you run Google tags, a TCF-registered CMP can satisfy both from a single user choice.

  • Keep your wider banner GDPR/ePrivacy compliant

    TCF covers the ad chain, not your entire consent obligation.

  • Review your vendor list and remove unused partners

    Fewer vendors means a clearer first layer and a simpler compliance surface.

7 min read

GPP, MSPA & US State Signals: A Publisher's Guide

The US Privacy String you built for CCPA was deprecated in January 2024. GPP, the US National string, and the MSPA replaced it, and getting the signal wrong can be a misrepresentation. Here's how the new US privacy signals move through the ad stack.

5 min read

Building a TCF CMP That Passes IAB Validation

What it takes for a Consent Management Platform to pass IAB Europe's TCF checks: a registered CMP ID, a cleanly decodable TC String, event-listener delivery, and encoding against the right GVL version.

9 min read

How to Migrate Your CMP Without Losing Existing Consent Records

A step-by-step technical guide to switching consent management platforms without losing consent records, triggering mass re-consent, or breaking Consent Mode. Covers export, category mapping, parallel runs, and zero-downtime migration patterns.