Transparency and Consent Frameworks (IAB TCF, USPrivacy, Google AC)
Access to the Consent Values
The SDK will set the shared preferences values for IAB TCF v1, IAB TCF v2, IAB USPrivacy and Google AC String. These values can be read by using the following code:
Context mContext = getApplicationContext();
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.OnSharedPreferenceChangeListener mListener;
mListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
if (key.equals([Specific Consent Key])) {
// Update Consent settings
}
}
};
mPreferences.registerOnSharedPreferenceChangeListener(mListener);
The following keys are defined:
IAB TCF v2 | |
IABTCF_CmpSdkID |
Number : The unsigned integer ID of CMP SDK |
IABTCF_CmpSdkVersion |
Number : The unsigned integer version number of CMP SDK |
IABTCF_PolicyVersion |
Number : The unsigned integer representing the version of the TCF that these consents adhere to. |
IABTCF_gdprApplies |
Number :
Unset - undetermined (default before initialization) |
IABTCF_PublisherCC |
String : Two-letter ISO 3166-1 alpha-2 code – Default: AA (unknown) |
IABTCF_PurposeOneTreatment |
Number :
Unset default - Vendors can use this value to determine whether consent for purpose one is required. |
IABTCF_UseNonStandardStacks |
Number :
|
IABTCF_TCString |
String : Full encoded TC string |
IABTCF_VendorConsents |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the consent status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is consent true for vendor ID 1
|
IABTCF_VendorLegitimateInterests |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the legitimate interest status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for vendor ID 1
|
IABTCF_PurposeConsents |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the consent status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
|
IABTCF_PurposeLegitimateInterests |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the legitimate interest status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
|
IABTCF_SpecialFeaturesOptIns |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the opt-in status for special feature ID n+1; false and true respectively. eg. '1' at index 0 is opt-in true for special feature ID 1
|
IABTCF_PublisherRestrictions{ID} |
String ['0','1', or '2'] : The value at position n – where n's indexing begins at 0 – indicates the publisher restriction type (0-2) for vendor n+1; (see Publisher Restrictions Types). eg. '2' at index 0 is restrictionType 2 for vendor ID 1 . {ID} refers to the purpose ID. |
IABTCF_PublisherConsent |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose consent status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
|
IABTCF_PublisherLegitimateInterests |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose legitimate interest status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
|
IABTCF_PublisherCustomPurposesConsents |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose consent status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is consent true for custom purpose ID 1
|
IABTCF_PublisherCustomPurposesLegitimateInterests |
Binary String : The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose legitimate interest status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is legitimate interest established true for custom purpose ID 1
|
IAB USPrivacy | |
IABUSPrivacy_String |
String : Aligns with IAB OpenRTB CCPA Advisory. The String encodes all choices and information. |
Google AC String | |
IABTCF_AddtlConsent |
|