IAB TCF 2.2

Overview

The TCF’s simple objective is to help all parties in the digital advertising chain ensure that they comply with the EU’s GDPR and ePrivacy Directive when processing personal data or accessing and/or storing information on a user’s device, such as cookies, advertising identifiers, device identifiers and other tracking technologies.

TCF v2.2

TCF v2.2 enables consumers to grant or withhold consent and also exercise their ‘right to object’ to data being processed. Consumers also gain more control over whether and how vendors may use certain features of data processing, for example, the use of precise geolocation.

Publishers employing TCF v2.2 gain greater control and flexibility with respect to how they integrate and collaborate with their technology partners. New publisher functionality allows them to restrict the purposes for which personal data is processed by vendors on a publisher’s app/website on a per-vendor basis.

OneTrust Configuration guidelines

OneTrust helps you to configure the IAB TCF version for your application by building the IAB template in OneTrust’s environment.

Accessing TC Data

Once a user gives consent, OneTrust will write the associated TCF data and save it to the device based on the IAB version your application is compliant with. Your application can access the data by fetching it using the following keys from local storage.

IAB TCF Keys

Key
IABTCF_CmpSdkID
IABTCF_CmpSdkVersion
IABTCF_gdprApplies
IABTCF_PolicyVersion
IABTCF_PurposeOneTreatment
IABTCF_UseNonStandardStacks
IABTCF_SpecialFeaturesOptIns
IABTCF_PublisherCC
IABTCF_PublisherConsent
IABTCF_PublisherLegitimateInterests
IABTCF_PublisherCustomPurposesConsents
IABTCF_PublisherCustomPurposesLegitimateInterests
IABTCF_PurposeConsents
IABTCF_PurposeLegitimateInterests
IABTCF_TCString
IABTCF_VendorConsents
IABTCF_VendorLegitimateInterests
IABTCF_PublisherRestrictions

Code Sample

const tcf = localStorage.getItem('IABTCF_TCString');
if (tcf !== null) {
	console.log(tcf)
}

Update Purpose Consent

This method will allow your application to update the consent value for an IAB purpose. Applications will have to pass a valid String value purpose identifier along with a boolean state. Calling this method will only update the local state of consent.

oneTrustTV.updatePurposeConsent(key, value)
  .then(function(suc){
		// success response
	}).catch(function(err){
		// error response
	});

Update Purpose Legitimate Interest

This method will allow your application to update legitimate interest value for an IAB purpose. Applications will have to pass a valid String value purpose identifier along with a boolean state. Calling this method will only update the local state of legitimate interest. To persist the updated values, applications will have to call saveConsent() method explicitly. If legitimate interest has been disabled in your templates, the value will not be updated.

oneTrustTV.updatePurposeLegitInterest(key, value)
  .then(function(suc){
		// success response
	}).catch(function(err){
		// error response
	});

Get locally Saved Purpose Consent

This method will allow your application to retrieve the local consent value for an IAB purpose / category. Applications will have to pass a valid String value purpose identifier. Calling this method will get the local state of consent if values are changed with updatePurposeConsent() method. If values are not changed, this will retrieve the last stored value.

oneTrustTV.getPurposeConsent(key)
  .then(function(suc){
		// success response
	}).catch(function(err){
		// error response
	});

Returns the following Integer values:

  • 1 = Consent Given
  • 0 = Consent Not Given
  • -1 = Invalid Group Id passed

Get locally Saved Purpose Legitimate Interest

This method will allow your application to retrieve updated legitimate interest value for an IAB purpose. Applications will have to pass a valid String value purpose identifier. Calling this method will get the local state of legitimate interest if values are changed with updatePurposeLegitInterest() method. If values are not changed, this will retrieve last stored value.

oneTrustTV.getPurposeLegitInterest(key)
  .then(function(suc){
		// success response
	}).catch(function(err){
		// error response
	});

Returns the following Integer values:

  • 1 = Consent Given
  • 0 = Consent Not Given
  • -1 = Invalid Group Id passed / Group Id does not have a Legitimate interest configured for it.

FAQs

Does the Mobile CMP support Global Scope?

No, as of the OneTrust 6.22 release, the Mobile CMP no longer supports Global Scope due to IAB Policy change. All TC Strings will be encoded with isServiceSpecific: true going forward to remain compliant with IAB TCF’s latest policy.