IAB TCF for developers and troubleshooting
How the TC string reaches your vendors, for developers.
Last updated About 8 hours ago
This article is for developers who work on a domain with IAB TCF on. For an overview, see What IAB TCF is and when you need it.
How vendors get the visitor's choice
With IAB TCF on, the visitor's choice is saved as a TC string. Your advertising vendors read it through the standard IAB TCF API, __tcfapi, as described in IAB's public TCF v2.2 specification.
Example: read the choice once it is ready or changes.
__tcfapi("addEventListener", 2, function (tcData, success) {
if (success && (tcData.eventStatus === "tcloaded" || tcData.eventStatus === "useractioncomplete")) {
// tcData.tcString holds the TC string
}
});Google's ad technology providers
When you use Google's ad technology providers, the visitor's choice for them is also saved as an Additional Consent string. It is passed in the same tcData object, as tcData.addtlConsent. That is the field Google's tags read.
Nothing is blocked automatically
Consent Studio does not block scripts automatically and does not delete cookies. Your ad tags and vendor scripts must read the TC string and follow it. That is the standard way IAB TCF works.
Your own categories
Your own categories (functional, analytics, marketing) keep working as before. See JavaScript: API.
Installation code

Important: With IAB TCF on, the installation code starts with a small IAB script that must run before any advertising script. So the code must be the first script on every page. If Consent Studio was installed before IAB TCF was switched on, replace the code with the current one from Web CMP → Implementation → Installation after going live. Installs through Webflow, Wix, WordPress, Shopify or the Google Tag Manager template do not support IAB TCF yet. Use the installation code instead.
Per domain
IAB TCF choices are not shared between domains. Only the choice for your own categories travels; the TC string applies to one domain. IAB TCF cannot be combined with pages at a booking or other platform.
Consent log
Each consent record also holds the visitor's TC string and, when you use Google's ad technology providers, the Additional Consent string. The record shows what they say per purpose and vendor, and the export includes both strings.
Troubleshooting
Check the state of the IAB TCF API in your browser console:
__tcfapi("ping", 2, function (pingReturn) {
console.log(pingReturn.cmpStatus, pingReturn.displayStatus);
});A vendor does not receive the choice. Check that the installation code is the first script on every page, before any advertising script. If Consent Studio was installed before IAB TCF was switched on, replace the code with the current one from Web CMP → Implementation → Installation. Installs through Webflow, Wix, WordPress, Shopify or the Google Tag Manager template do not support IAB TCF yet. Use the installation code instead.
A vendor is missing from the banner. Check that it is listed under Shown to visitors on Web CMP → IAB TCF → Vendors. Only listed vendors are shown.
Visitors still get the regular banner. Check that the setup was finished with Go live, and whether IAB TCF is switched off for the visitor's country in a geotargeting rule.
Google's tags do not read the Additional Consent string. Check that Google Advertising Products is one of your vendors and that you chose providers on the Google Ad Technology Providers tab.
Scripts run before consent. Consent Studio does not block scripts automatically. Each vendor script must read the TC string and follow it.
Related articles
Was this helpful?
Still need help? Ask the team