Skip to content
FunnelGuard

Fix guide by FunnelsGuard

IAB TCF string missing or invalid: how to find and fix it

TRK-300Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

The IAB Transparency and Consent Framework (TCF) is an industry standard used mostly in Europe. When a visitor makes a choice in your cookie banner, the banner (called a consent management platform, or CMP) builds a short encoded text called the TC string. It says which purposes and vendors the visitor agreed to.

Ad tags and vendors read that string through a browser function called __tcfapi. The string is usually also stored in a first-party cookie named euconsent-v2. The problem appears when the string is missing (never created), empty, expired, or invalid (wrong version, corrupted, or generated by an unregistered CMP).

Common causes: TCF mode is off in the CMP settings, the CMP script loads after the ad tags, the __tcfapi stub is missing from the page head, a caching or security plugin strips the cookie, or the CMP uses an outdated TCF version (v2.0 instead of v2.2).

Why it costs you leads or sales

Without a valid string, ad platforms and programmatic vendors cannot prove the visitor consented. They usually fall back to the safe option: no personalised ads, no conversion matching, or no ad at all. Google also expects a certified CMP with TCF for ads served in the EEA and UK.

The result is quieter than a broken form. Visitors still browse and buy, but remarketing audiences shrink, conversions go unreported and smart bidding has less data to learn from. You pay for traffic that the platforms cannot connect to results.

Where a missing TCF string breaks the chain
  1. Visitor clicks AcceptBanner records the choice
  2. TC string createdMissing or invalid
  3. Vendors read __tcfapiNo valid consent found
  4. Ads and conversionsLimited or not sent

The visitor consents, but the string is never created, so downstream steps lose the signal.

Reported conversions before and after a TCF fixExample numbers
Reported conversions before and after a TCF fix (example)Invalid string: 42 conversions per week; Valid string: 68 conversions per week026524268Invalid stringValid stringconversions per week

Example: illustrative numbers showing how conversions reported to an ad platform can recover once a valid TC string is passed.

How to check if your site has it

Check your TCF string in the browser
  1. Open the site in a private window

    Use an EU location or a VPN set to an EU country so the banner appears. Open DevTools (F12).

  2. Test that __tcfapi exists

    In the Console, type typeof window.__tcfapi. You should see "function". If you see "undefined", the CMP is not loading or TCF is off.

  3. Accept in the banner, then read the string

    Click Accept, then run the snippet below. Check that tcString is a non-empty text and gdprApplies is true for EU visitors.

  4. Check the cookie

    In DevTools go to Application, then Cookies, and look for euconsent-v2. Some CMPs store it elsewhere, such as local storage, so check their documentation.

  5. Decode the string

    Paste the string into a TC string decoder (the IAB Europe and several CMP vendors offer one). Confirm the version is 2, the CMP ID is yours and the purposes match your click.

Read the TC string in the consolejavascript
window.__tcfapi('getTCData', 2, function (tcData, success) {
  console.log('success:', success);
  console.log('gdprApplies:', tcData.gdprApplies);
  console.log('eventStatus:', tcData.eventStatus);
  console.log('tcString:', tcData.tcString);
  console.log('cmpId:', tcData.cmpId, 'version:', tcData.tcfPolicyVersion);
});
What the console result usually means
What you seeLikely meaning
__tcfapi is undefinedCMP not loaded, TCF disabled, or script blocked
success is falseCMP present but not ready or misconfigured
tcString is emptyNo choice stored yet, or storage failed
eventStatus is cmpuishownBanner shown but no choice made yet (normal)
Decoder shows unknown CMP IDCMP not registered with the IAB

How to fix it

Exact menu names depend on your CMP, so look for a setting called IAB TCF, TCF v2.2 or Transparency and Consent Framework. The steps below cover the common cases.

Fix a missing or invalid TC string
  1. Confirm your CMP is TCF-registered

    Check that your CMP appears on the IAB Europe CMP list and has a CMP ID. If it does not, switch to one that does.

  2. Turn TCF on in the CMP dashboard

    Enable the IAB TCF option, publish the configuration and select the vendors and purposes you use.

  3. Load the CMP first

    Place the CMP script as high as possible in the head, before Google Tag Manager, ad scripts and analytics. Do not add async or defer unless your CMP says it is safe.

  4. Update to TCF v2.2

    Older v2.0 or v2.1 strings are no longer accepted by many vendors. Update the CMP plugin or script to the latest version.

  5. Stop anything stripping the cookie

    Exclude the CMP script and the euconsent-v2 cookie from caching, security or cookie-cleaning plugins, and check that a CDN rule is not removing it.

  6. Test again after clearing cookies

    Clear site data, reload from an EU location, accept, and run the console check from the previous section.

Where to look on your platform
  1. Check the consent plugin settings

    In your CMP plugin (for example one that supports IAB TCF), enable the TCF option and save. Update the plugin to the latest version.

  2. Exclude from caching and minify

    In your cache or optimisation plugin, exclude the CMP script from delay, defer and combine options so it loads first.

How to confirm it's fixed

Confirmation checks
  • typeof window.__tcfapi returns "function" on page load
  • getTCData returns success true and a non-empty tcString after Accept
  • gdprApplies is true for an EU visitor
  • The decoder shows version 2 and your CMP ID
  • The euconsent-v2 cookie exists after a choice and survives a page reload
  • After Reject all, the string shows purposes denied and ad tags do not send data
  • Google tag diagnostics or your ad platform's consent status no longer reports missing consent

How to prevent it happening again

Prevention habits
  • Re-run the console check after every CMP, theme, plugin or tag manager change
  • Keep the CMP plugin or script updated to the current TCF version
  • Subscribe to your CMP vendor's notices about TCF policy updates
  • Keep the CMP at the top of the head and out of delay or defer rules
  • Test from an EU location, not just from your own country
  • Add a quarterly check to your launch checklist for new pages and domains

How FunnelGuard handles this

FunnelGuard does not check TCF strings yet. Validating the TC string is a possible future check, but today it is not something FunnelGuard tests.

What FunnelGuard does do is run your real customer journeys on a schedule from the EU or the US and check that the tracking hits to GA4, Google Ads, Meta and other platforms are actually sent. If a consent problem leaves a conversion hit missing, a failed step is re-checked from a second region and you get one alert with a screenshot and a likely cause. That tells you the symptom, not that the TC string is the reason.

To watch for the TCF problem itself, run the console check above after each release, use your CMP's own dashboard or consent reports, and review the consent status in your ad platform's diagnostics. A free plan with 1 site and 2 journeys is available if you want automated tracking checks alongside.

Questions people ask

What is a TCF string?

A TCF string, or TC string, is a coded line of text created by a cookie banner that follows the IAB Transparency and Consent Framework. It records which purposes and vendors a visitor accepted or rejected. Ad vendors read it to decide what they may do with that visitor's data.

Why is my TCF string missing?

The usual causes are TCF mode being switched off in your CMP, the CMP script loading after ad tags or being blocked, or a cache or security plugin removing the euconsent-v2 cookie. It can also be empty simply because the visitor has not made a choice yet.

How do I check if my TCF string is valid?

Open DevTools in an EU location, accept the banner, and run window.__tcfapi('getTCData', 2, callback) in the console. A valid result has success true, gdprApplies true and a non-empty tcString. Paste the string into a TC string decoder to confirm version 2 and your CMP ID.

Where is the TCF string stored?

Most CMPs store it in a cookie named euconsent-v2, and some also use local storage. Vendors normally read it through the __tcfapi function rather than the cookie directly. Check your CMP's documentation if you cannot find it.

Do I need TCF for Google Ads?

For serving ads to users in the EEA and UK, Google requires a Google-certified CMP, and publishers using Google ad products with TCF need a compliant string. Check Google's current requirements for your setup, since they are updated over time.

Why does the TCF string show gdprApplies false?

The CMP is treating the visitor as outside the regions where GDPR applies, often because of geolocation rules or because you tested from outside the EU. Test from an EU location and review the region rules in your CMP settings.

Can FunnelGuard detect an invalid TCF string?

No. FunnelGuard does not check TCF strings yet. It does run your journeys and check tracking hits, so it can show that conversions are not being sent, but you need the console check or your CMP's reports to confirm the string itself.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.