HTML Advanced
IAB TCF
Load the IAB build
Load c15t.iab.js instead of c15t.js when your policy uses IAB TCF. It
contains the CMP, the TC string encoder, the IAB banner and the purpose and
vendor preference dialog. c15t.js, c15t.local.js and
c15t.headless.js leave all of that out, so pages without an IAB policy stay
smaller. The stock banner on those builds stands aside for a policy that
uses the iab model, so a page that resolves one emits an error event and
throws an IABUnavailableError (code C15T_IAB_UNAVAILABLE) as an uncaught
error. So does c15t.iab.js with iab: false. Load c15t.iab.js for
visitors whose policy uses IAB TCF, or remove the iab model from the
policy.
Replace YOUR_CMP_ID with the ID IAB Europe assigned your CMP at
registration. Every TC string names the
CMP that wrote it, so never copy an ID from an example. A backend can supply
cmpId and the vendor list instead. vendors limits the list to the vendors
your site works with.
Load only one c15t bundle. c15t.iab.js throws an error if c15t.js,
c15t.local.js or c15t.headless.js loaded first. When the resolved policy is not an IAB
policy, the IAB build shows the ordinary banner. If an IAB policy cannot load
its vendor list, the banner shows an error and keeps its confirm buttons
disabled.
A self-hosted backend serves this build at
/c15t.iab.js. Set script.config.iab on the backend to supply CMP defaults.
Confirm IAB choices from your code
c15t.acceptAll() and c15t.rejectAll() confirm through the CMP when the
policy is IAB. For individual choices, change the draft on the CMP handle and
confirm it with c15t.saveIAB():
ready() waits for the policy. cmp.whenReady() waits for the vendor list and
CMP setup, and rejects if setup fails. The handle also has
setPurposeLegitimateInterest, setVendorLegitimateInterest and
setSpecialFeatureOptIn. Each edits the draft; saveIAB() confirms it.
c15t.save({ ... }) with categories fails under an IAB policy, because it
cannot produce a TC string.
The CMP installs window.__tcfapi. c15t.dispose() removes it.
How the stock dialog groups choices
In the stock preference dialog, turning on a purpose also gives consent to the vendors that use that purpose on a consent basis. A purpose's legitimate-interest control changes the purpose and its legitimate-interest vendors, and turning it off records an objection. A stack's control covers its purposes and their consent-based vendors, and shows a mixed state when only some are on. The vendor tab has search, per-vendor consent and legitimate-interest controls, and each vendor's disclosures from the Global Vendor List.
The runtime.iab setters each change only the choice they name. A custom UI
that wants the same grouping must set the related vendor choices itself.
Add Google Additional Consent
Google's Additional Consent (AC) string carries consent for Google ad tech providers (ATPs) that are not on the IAB Global Vendor List. The TC String cannot name them, so without an AC string those providers get no consent signal and Google cannot serve personalised ads through them.
Take the provider IDs from Google's Additional Consent provider list. c15t ignores IDs that Google does not list. When Google removes a provider from the list, usually because it joined the Global Vendor List, it leaves the AC string on the visitor's next page load.
List the providers on your backend
A self-hosted backend lists the providers in its manifest's iab block,
next to customVendors. It loads each provider's name and privacy policy the
way it loads the vendor list, caches them, and sends them in /init to every
visitor whose policy uses IAB TCF. Framework servers and browsers that
resolve /init from the manifest load the same providers.
The backend's additionalConsent option sets the cache, which defaults to the
gvl cache, and enabled: false stops /init from serving the providers. See
instance options.
List the providers in the browser
Local mode has no backend, and some backends do not list providers. In
those setups, pass additionalConsent with your other IAB options: the
IABProvider props in React, Next.js and TanStack Start, the createIAB
options in JavaScript, and the iab option of the Vue, Nuxt, Svelte, Astro
and script-tag setups. A list passed here replaces the one the backend sent.
What the visitor sees
The Vendors tab of the preference centre gets a Google Ad Tech Providers section. Each provider shows its name, a link to the privacy policy Google lists for it, and a consent switch. Accept All switches every provider on, and Reject All switches them off. The banner's partner count includes them.
The names and links come from https://gvl.inth.app/additional-consent.
The backend fetches them when the providers are listed in its manifest. When
they are listed in the browser, c15t fetches them as the CMP mounts, in
parallel with the vendor list. To serve the list yourself, set endpoint in
the manifest's additionalConsent, or url in the browser option. c15t
requests ?providerIds=89,2572 and expects JSON in this shape:
If the list does not load, the response carries no providers and c15t writes no AC string. The TC String works as before.
What vendors receive
After the visitor saves, __tcfapi returns the AC string as addtlConsent,
next to tcString, from getTCData, getInAppTCData and addEventListener
callbacks. It uses version 2 of Google's format, for example 2~89~dv.2572.
The part before ~dv. lists the providers the visitor consented to. The part
after it lists the providers they were shown but did not consent to. After
Reject All, every provider is in the second part: 2~~dv.89.2572.
A provider counts as consented only when its switch is on and the visitor also consented to TCF purposes 1, 3 and 4: storing information on the device, and creating and using profiles for personalised advertising. Google's spec requires consent to device storage and to personalised ads before a provider can be listed as consented. Without those purposes, the provider is listed as shown only.
c15t writes an AC string only together with a TC String, because Google
discards an AC string that arrives without one. It stores the string in the
addtl_consent cookie and localStorage entry next to euconsent-v2, and
removes both when it withdraws the TC String. A returning visitor gets their
saved provider choices back. A provider you add later has not been shown to
them, so it stays out of their AC string until they save again. A provider
you remove and add back keeps the choice the visitor saved for it.
When the visitor's policy does not use IAB TCF, __tcfapi reports
gdprApplies: false and returns no tcString or addtlConsent. CMP API v2
allows only cmpId, cmpVersion and tcfPolicyVersion beside it, plus the
status fields.
A self-hosted backend records the AC string with each consent, in the
addtlConsent column of the consent table beside the TC String. Run the
backend's migrations after upgrading to add the column. Consents recorded
before then, and consents saved without a TC String, store null.
Send the string with ad requests
Pixels and ad requests that cannot call __tcfapi take the AC string in the
addtl_consent URL parameter. Google's ad renderers replace the
${ADDTL_CONSENT} macro, as in &addtl_consent=${ADDTL_CONSENT}. For
requests your own code builds, read the string from __tcfapi, add it next
to the TC String, and then send the request. This pixel fires once the CMP
answers with TCF data:
Ask Google to list your CMP ID
Google accepts AC strings only from a CMP registered with IAB Europe, using its own CMP ID. It lists the CMPs it has certified on its Additional Consent page. Ask Google to list your CMP ID through its CMP intake form before you rely on the AC string in production.
c15t's IAB CMP registration
Inth makes c15t. Inth's legal entity, Consent Management Inc., is registered with IAB Europe as a CMP under CMP ID 490. The IAB Europe CMP list shows it under the name Consent Management Inc.
How the preference centre shows features
The stock IAB preference centres in React, Next.js, Vue, Svelte, Astro and the script tag follow TCF 2.4 and Policies v5.0.b. Special purposes stay in their locked section with a lock icon, because the visitor cannot object to them.
Features get their own section after the special purposes. It shows the IAB
standard text for features from the Global Vendor List's
standardTexts.features. If the list has no standard text, it shows the
iab.preferenceCenter.features.description translation. Each feature lists
its name, description, illustrations and the vendors that use it. The section has no switch, lock or vendor toggle, because
TCF forbids showing features next to a control that cannot be disabled.
The feature section follows the theme's spacing and typography tokens. Its disclosure arrows are decorative and stay out of the accessibility tree.
A custom preference UI gets the same rows from
resolveIABDialogDisplayModel in @c15t/iab/headless. essentialRows holds
the special purposes only. featureRows holds the features, with
locked: false and toggle: 'none', so render them without a control.
featuresStandardText is the standard text, or null when you should use the
translation.
Each vendor's privacy policy and legitimate interest links come from its
urls[] entry in the Global Vendor List. The stock preference centres pick
the entry for the language the banner shows, then English. A custom UI gets
the same links from resolveIABVendorUrls(vendor, language) in
@c15t/iab/headless, or from policyUrl and legitimateInterestUrl on the
vendors processGVLForDialog returns when you pass it language. Vendor lists
older than GVL v3 have a single policyUrl field, which c15t still reads.
Consent scope
c15t stores TCF choices per site and browser, which the TCF calls
service-specific scope. It does not sync TC strings across devices, and every
TC string it writes has IsServiceSpecific set to 1.
Do not use /consent/check or your own account data to skip the TCF banner on
another device. That turns the choice into multi-device scope, which the TCF
requires you to disclose in the first layer, and c15t does not show that
disclosure. The isServiceSpecific option is deprecated. c15t ignores it and
logs a warning when you pass false.
Style and word the IAB UI
The IAB UI takes the same ui.theme, ui.css and ui.shadow options as the
ordinary banner; see customize. With
shadow: false and your own stylesheet, load both dist/c15t.css and
dist/c15t.iab.css from the package.
The IAB banner always shows the c15t branding. ui.dialog.hideBranding hides
it in the preference dialog. ui.banner.title, description and the button
text options apply to the IAB banner too, and a description can include
{partnerCount}. ui.iab.loadErrorText, saveErrorText and
moreVendorsText change the loading error, save error and pagination copy.
Set ui: false to render your own IAB UI against the client. The page still
downloads the IAB build.
Try it locally
The repository's internals/fixtures/script-tag/iab.html runs the IAB build in local mode
with a sample vendor list. Build @c15t/browser, run
bun run --cwd internals/fixtures/script-tag dev and open /iab. It uses a
demonstration CMP ID; replace it with your own for a real site.