Implement the Transparency & Consent Framework

This page is for consent management platform (CMP) developers who want to use the TCF framework to transmit consent signals to Google tags.

The IAB Transparency & Consent Framework (TCF) is an open-standard technical framework that enables websites, advertisers, and ad agencies to obtain, record, and update consumer consent for web pages.

To control Google Analytics cookies, integrate with consent mode.

You can enable the consent mode TCF integration using either of the following methods.

CMP API

Set the enableAdvertiserConsentMode field to true in TCData objects generated by your TCF consent management platform API implementation.

TCData.enableAdvertiserConsentMode = true

Website

To enable TCF support, set the property to true on each website that should support TCF, even on pages that are loaded through an iframe.

window['gtag_enable_tcf_support'] = true

Apps

TCF integrations may be automatically enabled by your CMP. You can disable the integration by updating your AndroidManifest.xml (Android) or info.plist (iOS) file.

For Android:

<metadata android:name="google_analytics_tcf_data_enabled" android:value="false" />

For iOS:

<key>GOOGLE_ANALYTICS_TCF_DATA_ENABLED</key> <false/>

TCF integration behavior

The Google tag and the Google Analytics for Firebase SDK only accept TCF strings that are correctly implemented according to the TCF policies and technical specifications, and adhere to Google's EU User Consent Policy.

For web tag integrations, if the CMP doesn't respond within 500 milliseconds or you see "error", "stub", or "loading" status, the tag will proceed with default consent settings.

Learn how to troubleshoot TCF implementations.

When enabled, the consent mode TCF integration maps from TCF Purposes to consent mode commands as follows.

Purpose Description Google tag behavior when Purpose is denied
1 Store and/or access information on a device. ad_storage = denied
ad_user_data = denied
3 Create a personalised ads profile ad_personalization = denied
4 Select personalized ads ad_personalization = denied
7 Measure ad performance ad_user_data = denied

Disables the Google signals feature in Google Analytics (for web tags only).

9 Apply market research to generate audience insights

Disables the Google signals feature in Google Analytics (for web tags only).

10 Develop and improve products

Disables the Google signals feature in Google Analytics (for web tags only).

Next steps

If you plan to provide your customers with a tag they can use in Google Tag Manager, create a tag template for your banner.