TCF v2.0 Consent

If you implemented a consent management platform (CMP) that complies with the IAB Transparency & Consent Framework v2.0 (TCF) for the user consent flow, the Yandex Mobile Ads SDK supports sending TCF v2.0 values.

Yandex Mobile Ads SDK retrieves TCF v2.0 consent strings from SharedPreferences using the following keys:

IABTCF_TCString

String

Fully encoded TC string.

IABTCF_gdprApplies

Number

  • 1: GDPR applies in the current context.
  • 0: GDPR doesn't apply in the current context.
  • Unset: Unknown (default before initialization).

IABTCF_CmpSdkID

Number

Unsigned integer ID of the certified CMP used.

IABTCF_PurposeConsents

Binary String

"0" or "1" at position n, where n's indexing begins at 0. Indicates the consent status for purpose ID n+1. 0 corresponds to false, and 1 corresponds to true. For example, "1" at index "0" is consent true for purpose ID 1.

IABTCF_VendorConsents

Binary String

"0" or "1" at position n, where n's indexing begins at 0. Indicates the consent status for vendor ID n+1. 0 corresponds to false, and 1 corresponds to true. For example, "1" at index 0 is consent true for vendor ID 1.

IABTCF_AddtlConsent

String

AC string with the specification version and IDs of ad technology providers consented by the user.

For a detailed description, see the IAB documentation.

Passing values to SharedPreferences

Make sure to set required key values before making ad requests and use certified CMPs. See the up-to-date CMP list compliant with IAB Europe recommendations here. Once the user's consent is obtained, the CMP writes all data to SharedPreferences by keys, while the Yandex Mobile Ads SDK automatically reads the data.