Tcf V2 Implementation logo

Tcf V2 Implementation

Community
mukul975
tcf-v2-implementation

Implementing the IAB Transparency and Consent Framework v2.2 for programmatic advertising consent management. Covers CMP registration, Global Vendor List integration, TC String encoding, publisher restrictions, and compliance validation.

Overview

Publishermukul975
RepositoryPrivacy-Data-Protection-Skills
Skill nametcf-v2-implementation
Stars
279
Forks
59
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mukul975 on GitHub. Read the source before you install it.

Installation

Install the Tcf V2 Implementation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git /tmp/Privacy-Data-Protection-Skills
mkdir -p .claude/skills
cp -r /tmp/Privacy-Data-Protection-Skills/plugins/cookie-consent-skills/skills/tcf-v2-implementation .claude/skills/tcf-v2-implementation
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tcf V2 Implementation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Tcf V2 Implementation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Tcf V2 Implementation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

IAB TCF v2.2 Implementation

Overview

The IAB Europe Transparency and Consent Framework (TCF) v2.2, released in May 2023 as an update to v2.0, provides a standardized mechanism for collecting, encoding, and distributing user consent signals across the programmatic advertising supply chain. Publishers, advertisers, and ad technology vendors use TCF to communicate consent status through the TC String — a compact, base64url-encoded data structure. TCF v2.2 introduced key changes including the removal of legitimate interest as a legal basis for cross-device targeting (Purpose 2 in part) and restrictions on certain vendor practices.

TCF v2.2 Architecture

Core Components

  1. Consent Management Platform (CMP): The user-facing interface that collects consent. Must be registered with IAB Europe and assigned a CMP ID.
  2. Global Vendor List (GVL): A centralized registry of ad technology vendors, maintained by IAB Europe, listing each vendor's declared purposes and legal bases.
  3. TC String: The encoded consent signal transmitted through the ad supply chain.
  4. CMP API (__tcfapi): A JavaScript API that vendors call to read the current consent state.

Implementation for Pinnacle E-Commerce Ltd

Step 1: CMP Registration

Register Pinnacle E-Commerce Ltd's CMP with IAB Europe:

Registration FieldValue
CMP NamePinnacle Consent Manager
PublisherPinnacle E-Commerce Ltd
CMP IDAssigned by IAB Europe upon registration (e.g., 432)
Supported TCF version2.2
GVL versionLatest (auto-updated weekly)
CMP JavaScript URLhttps://cmp.pinnacle-ecommerce.com/tcf-v2.js

Registration requirements:

  • Demonstrate CMP compliance with IAB TCF Policies
  • Pass IAB Europe CMP validation testing
  • Agree to the CMP Terms and Conditions
  • Implement the __tcfapi stub before the full CMP loads
Step 2: Global Vendor List Integration

The GVL is published at https://vendor-list.consensu.org/v3/vendor-list.json and contains:

json
{
  "gvlSpecificationVersion": 3,
  "vendorListVersion": 287,
  "tcfPolicyVersion": 4,
  "lastUpdated": "2026-03-01T12:00:00Z",
  "purposes": {
    "1": {
      "id": 1,
      "name": "Store and/or access information on a device",
      "description": "Cookies, device or similar online identifiers...",
      "illustrations": ["..."]
    }
  },
  "vendors": {
    "755": {
      "id": 755,
      "name": "Google Advertising Products",
      "purposes": [1, 3, 4],
      "legIntPurposes": [2, 7, 9, 10],
      "flexiblePurposes": [2, 7, 9, 10],
      "specialPurposes": [1, 2],
      "features": [1, 2],
      "specialFeatures": [],
      "policyUrl": "https://policies.google.com/privacy",
      "cookieMaxAgeSeconds": 63072000,
      "usesCookies": true,
      "usesNonCookieAccess": true
    }
  }
}

GVL Management for Pinnacle E-Commerce Ltd:

  1. Cache the GVL locally with a maximum staleness of 24 hours
  2. Display only vendors that Pinnacle E-Commerce Ltd actually uses (vendor subset)
  3. Show vendor count in the consent banner: "We work with 47 advertising partners"
  4. Provide a searchable vendor list in the detailed consent layer

Pinnacle E-Commerce Ltd Vendor Subset:

Vendor IDVendor NamePurposesLegal Basis
755Google Advertising Products1, 3, 4Consent
91Criteo SA1, 2, 3, 4, 7Consent
42Taboola Inc.1, 2, 3, 4, 5, 7Consent
69OpenX Technologies1, 2, 3, 4, 7Consent
253Meta Platforms, Inc.1, 2, 3, 4, 7, 10Consent
Step 3: TCF v2.2 Purposes

The 11 TCF purposes and their mapping for Pinnacle E-Commerce Ltd:

TCF PurposeNameLegal Basis at Pinnacle
1Store and/or access information on a deviceConsent only
2Select basic adsConsent only
3Create profiles for personalised advertisingConsent only
4Use profiles to select personalised adsConsent only
5Create profiles to personalise contentConsent only
6Use profiles to select personalised contentConsent only
7Measure ad performanceConsent only
8Measure content performanceConsent only
9Understand audiences through statistics or combinations of data from different sourcesConsent only
10Develop and improve servicesConsent only
11Use limited data to select contentConsent only

Special Purposes (always allowed, no consent required):

  • SP1: Ensure security, prevent and detect fraud, and fix errors
  • SP2: Deliver and present advertising and content

Features (declared, not consented to individually):

  • F1: Match and combine data from other data sources
  • F2: Link different devices
  • F3: Receive and use automatically-sent device characteristics for identification

Special Features (require explicit consent):

  • SF1: Use precise geolocation data
  • SF2: Actively scan device characteristics for identification
Step 4: TC String Structure

The TC String is a base64url-encoded binary string containing:

Core String Segments:

FieldBitsDescription
Version6TCF version (value: 2)
Created36Deciseconds since 01/01/2020 00:00:00 UTC
LastUpdated36Deciseconds since 01/01/2020 00:00:00 UTC
CmpId12CMP ID (Pinnacle: 432)
CmpVersion12CMP version number
ConsentScreen6Screen number in CMP where consent was given
ConsentLanguage12ISO 639-1 language code
VendorListVersion12GVL version used
TcfPolicyVersion6TCF Policy version (value: 4)
IsServiceSpecific11 = publisher-specific TC String
UseNonStandardStacks1Whether non-IAB standard stacks are used
PurposeConsents24Bitfield for purpose consent (purposes 1-24)
PurposeLegitimateInterests24Bitfield for purpose LI
PurposeOneTreatment10 = purpose 1 was disclosed; 1 = not
PublisherCC12ISO 3166-1 alpha-2 publisher country code

Vendor Consent Section: Variable-length encoding of per-vendor consent using either a bitfield or range encoding, depending on which is more compact.

Publisher Restrictions Section: Overrides vendor-declared legal bases at the publisher level.

Step 5: Publisher Restrictions

Pinnacle E-Commerce Ltd applies publisher restrictions to enforce consent-only for all purposes:

json
{
  "publisherRestrictions": [
    {
      "purposeId": 2,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69]
    },
    {
      "purposeId": 7,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69, 253]
    },
    {
      "purposeId": 9,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69]
    },
    {
      "purposeId": 10,
      "restrictionType": 1,
      "vendorIds": [91, 42, 69, 253]
    }
  ]
}

Restriction types:

  • 0 = Purpose flatly not allowed by publisher
  • 1 = Require consent (override legitimate interest)
  • 2 = Require legitimate interest (override consent)
  • 3 = Vendor requires both consent and LI to process
Step 6: CMP API Implementation

The __tcfapi must be available before any vendor scripts load:

Stub Implementation (loads first):

javascript
(function() {
  var queue = [];
  var tcfapi = function(command, version, callback, parameter) {
    if (command === 'addEventListener') {
      queue.push({ command: command, callback: callback });
    } else {
      queue.push({ command: command, version: version, callback: callback, parameter: parameter });
    }
  };
  tcfapi.queue = queue;
  window.__tcfapi = tcfapi;
})();

Supported Commands:

CommandDescription
getTCDataReturns the TC String and parsed consent data
pingReturns CMP status and loading state
addEventListenerRegisters a callback for consent changes
removeEventListenerRemoves a registered callback
getInAppTCDataReturns TC data for in-app (mobile) contexts

getTCData Response:

json
{
  "tcString": "CPyXXYAPyXXYAAGABCENB4CgAP_AAH_AAAAAHfoBpDxkBSFCAGJoYtkgAAAGxwAAICACABAAoAAAABoAIAQAAAAQAAAgBAAAABIAIAIAAABAGEAAAAAAQAAAAQAAAEAAAAAAIQIAAAAAAiBAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAAAQAA",
  "tcfPolicyVersion": 4,
  "cmpId": 432,
  "cmpVersion": 1,
  "gdprApplies": true,
  "eventStatus": "useractioncomplete",
  "purpose": {
    "consents": { "1": true, "2": false, "3": false, "4": false, "7": true },
    "legitimateInterests": {}
  },
  "vendor": {
    "consents": { "755": true, "91": false, "42": false },
    "legitimateInterests": {}
  },
  "publisher": {
    "restrictions": { "2": { "91": 1, "42": 1, "69": 1 } }
  }
}

TCF v2.2 Compliance Validation

Validation Checklist

RequirementVerification Method
CMP registered with IAB EuropeCheck CMP ID in IAB registry
GVL version current (within 7 days)Parse TC String VendorListVersion field
TC String decodes correctlyUse IAB reference decoder
Purpose 1 consent collected before device storageVerify no cookies set pre-consent
Publisher restrictions encodedDecode TC String restrictions segment
__tcfapi responds to pingCall __tcfapi('ping', 2, callback)
Consent UI shows all declared purposesCompare UI with GVL purposes
Vendor list matches GVL subsetCompare displayed vendors with GVL
TC String transmitted in bid requestsInspect OpenRTB consent field

Key Legal and Technical References

  • IAB Europe TCF v2.2 Technical Specification (May 2023) — TC String format, CMP API, GVL structure
  • IAB Europe TCF Policies v4 — Rules governing CMPs and vendors
  • IAB Europe CMP Validator Tool — Automated TC String validation
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Legal basis for TCF Purpose 1
  • CJEU Case C-673/17 (Planet49) — Active consent requirements
  • Belgian DPA Decision 21/2022 (IAB Europe) — Found IAB Europe a data controller for TC String; TCF must ensure valid GDPR consent
  • GDPR Article 4(11) — Consent definition applicable to TCF consent signals

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tcf V2 Implementation AI skill do?

Implementing the IAB Transparency and Consent Framework v2.2 for programmatic advertising consent management. Covers CMP registration, Global Vendor List integration, TC String encoding, publisher restrictions, and compliance validation.

Why use Tcf V2 Implementation on TypingMind?

Because you install it once and use it with any model. Tcf V2 Implementation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Tcf V2 Implementation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mukul975/Privacy-Data-Protection-Skills/tree/main/plugins/cookie-consent-skills/skills/tcf-v2-implementation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tcf V2 Implementation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Tcf V2 Implementation?

As many as you like. As long as a model supports skills, you can use Tcf V2 Implementation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Tcf V2 Implementation AI skill free?

Yes. It is published on GitHub by mukul975 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇