Skip to content

Google Consent Mode

Google Consent mode helps you to obtain your users consent and pass it to Google seamlessly. Consequently, Google tools adjust their behaviors automatically. Google further supplements this by filling gaps through conversion modeling and behavioral modeling, aiding you in achieving your marketing goals. For mobile applications, this is crucial to ensure the proper functioning of Firebase Services.

Those who do not have consent mode enabled will not be able to capture new EEA users in their audiences starting from March 2024.

To successfully incorporate Google Consent Mode V2 into your mobile application, there are a few essential steps to ensure a seamless integration process.

Google created four new types of consent types which includes:

Consent Type Description
ad_storage Enables storage, such as cookies (web) or device identifiers (apps), related to advertising.
ad_user_data Sets consent for sending user data to Google for online advertising purposes.
ad_personalization Sets consent for personalized advertising.
analytics_storage Enables storage, such as cookies (web) or device identifiers (apps), related to analytics, for example, visit duration.

More details can be found in their official documentation.

Setting up Account Settings

To streamline all consent types to Google, it's crucial to adhere to the steps outlined below. Following are instructions according to the chosen legal framework available on our Admin Interface.

Google adheres entirely to TCF policies and is registered as a vendor with ID 755 on IAB Global Vendor List (check out the Vendor List).

Therefore, it's mandatory to select this vendor from the Global Vendor List to enable the SDK to signal Consent Mode accurately.

Google Vendor

Full overview of the purposes and corresponding consent types can be found in the official documentation.

Example banner:

First Layer

After end-user interacts with the banner, the following scenarios could happen:

- Accept All ✅
  All Consent Types will be set to true.

- Deny All ❌
  All Consent Types will be set to false.

- Save Settings (granular choices) 📋
  This is the trickiest scenario because the Consent Types may have different values, since it will vary according to the consent given to Google Adverting Products TCF Vendor, Purposes being used and their Legal Basis.
  Short example showing which options users could customize:

Google Vendor
Please, check Google's official documentation to have an overview of possible outcomes of granular choices made by the end-user.

We always set the enableAdvertiserConsentMode flag to true, delegating the interpretation of the TCString to Google in order to infer consents.

For more details on how Google will process the generated TCString, click here.

When using GDPR only, if you need to have all the four Consent Type flags set, you need to add two Data Processing Services.

In order to set values related to Analytics data Collection, you should add in the Admin Interface the DPS named Google Analytics for Firebase with template ID diWdt4yLB.

We will update the analytics_storage flag and set Analytics Collection enabled or disabled, according to the consent given to Google Analytics for Firebase.

In order to set values related to Advertising data Collection, you should add in the Admin Interface the DPS named Google Analytics Advertising for Firebase with template ID GqhZxB-iiydzEk.

We will update the flags ad_storage, ad_user_data and ad_personalization according to the consent given to Google Analytics Advertising for Firebase.

More details on how we implement the signaling, check out our Consent Mediation documentation.

Firebase Analytics

Configuring the SDK

1. Integrate with Usercentrics SDK starting from version 2.13.2.

2. Activate the Usercentrics Consent Mediation Feature:

let options = UsercentricsOptions(..., consentMediation: true)

Refer to the specific set of the documentation for more detailed instructions if needed.

3. Add Firebase Library to your app:

Use the minimum version of 10.17.0. Please refer to its guide for detailed instructions on integration.

4. Add the Consent Mode keys to your app's info.plist file:

Assign false values to the keys to establish default permission where GDPR or another legal framework requires consent to be explicitly given.

More information can be found here.

<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS</key> <false/>

1. Integrate with Usercentrics SDK starting from version 2.13.2.

2. Activate the Usercentrics Consent Mediation Feature:

val options = UsercentricsOptions(..., consentMediation = true)

Refer to the specific set of the documentation for more detailed instructions if needed.

3. Add Firebase Library to your app:

Use the minimum version of 21.5.0 or 32.5.0 if you want to use the Firebase Android BoM. Please refer to its guide for detailed instructions on integration.

4. Add the consent mode keys to your app's AndroidManifest.xml file:

Assign false values to the keys to establish default permission where GDPR or another legal framework requires consent to be explicitly given.

<meta-data android:name="google_analytics_default_allow_analytics_storage" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_storage" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_user_data" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_personalization_signals" android:value="false" />

1. Enable Consent Mediation on Usercentrics Prefab.

Consent Mediation

2. Please use the minimum version of 11.7.0.

3. Please refer to its guide.

4. Make sure to add default keys for each platform to establish default permission where GDPR or another legal framework requires consent to be explicitly given.

Android (AndroidManifest.xml):

<meta-data android:name="google_analytics_default_allow_analytics_storage" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_storage" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_user_data" android:value="false" />
<meta-data android:name="google_analytics_default_allow_ad_personalization_signals" android:value="false" />

iOS (Info.plist):

<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA</key> <false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS</key> <false/>

That's it! 🚀 we will now apply the consent mode to Firebase Analytics SDK.

Basic vs Advanced Mode

Google delineates its implementation strategies into two categories: Basic and Advanced modes.

The key differences are:

  • Basic Implementation

    • Google SDKs are NOT loaded until end-user interacts with a consent banner.
  • Advanced Implementation

    • Google SDKs are loaded BEFORE end-user interacts with a consent banner.

Usercentrics approach

Our SDK operates within the realm of Advanced Implementation, ensuring a comprehensive integration.

Why? Our approach never restricts any SDK from operating within any app or game.

When Google SDKs are loaded alongside Usercentrics, you're choosing an Advanced Implementation approach. Usercentrics will then send the consent signals once it has been initialized.

We signal Consent using Privacy APIs exposed by Third-Party SDKs, like described on our Consent Mediation documentation.

Following the guidance above, Google SDKs will automatically identify the default consent status, which is initially set to false in scenarios where GDPR or another legal framework requires consent to be explicitly given.

If you wish to implement the Basic approach, make sure to only initialize Firebase SDK after the end-user interacted with the banner.

Integration with Adjust

Following the guidance on the Consent Mediation page for integrating Adjust, Usercentrics will signal provided flags to fully enable Google Consent Mode.

When Adjust is present on the DPS list and is configured according to the TCF 2.2 Framework + GDPR, we will follow the previously described rules for processing Consents and Legitimate Interests, regardless if user provided consent to Adjust DPS.

In case of a negative consent to Adjust, we keep signaling the decision of the user and the granular options detailed below.

Granular Flags

Consent Type Values Description
eea "1" (positive) or "0" (negative) This parameter informs whether users installing the app are within the European Economic Area (apart from EU member states, this currently includes Switzerland, Norway, Iceland and Slovenia).
ad_user_data "1" (positive) or "0" (negative) This parameter informs whether users consented with their advertiser ID being leveraged for attribution purposes.
ad_personalization "1" (positive) or "0" (negative) This parameter informs whether users consented with being served personalized ads via Google Ads and/or Google Marketing Platform. To reduce effort, this parameter will also inform the npa parameter that is reserved for Google Marketing Platform.

Our Integration

In this section, we provide a detailed overview of our methods for signaling consents to Adjust.

import Adjust

let consent = "1" || "0"

let thirdPartySharing = ADJThirdPartySharing.init(isEnabledNumberBool: nil)

thirdPartySharing.addGranularOption("google_dma", "eea", consent)
thirdPartySharing.addGranularOption("google_dma", "ad_user_data", consent)
thirdPartySharing.addGranularOption("google_dma", "ad_personalization", consent)

Adjust.trackThirdPartySharing(thirdPartySharing)
import com.adjust.sdk.AdjustThirdPartySharing

val consent = "1" || "0"

val thirdPartySharing = AdjustThirdPartySharing(null)

thirdPartySharing.addGranularOption("google_dma", "eea", consent)
thirdPartySharing.addGranularOption("google_dma", "ad_user_data", consent)
thirdPartySharing.addGranularOption("google_dma", "ad_personalization", consent)

Adjust.trackThirdPartySharing(thirdPartySharing)

FAQ

  • How to verify the integration with Usercentrics SDK?

    • By enabling the debug mode, check out the console to see our logs, example:
      [USERCENTRICS][DEBUG] [Mediation] Applied Granular Consent to Firebase - MediationGranularConsent(eea=true, analyticsStorage=false, adStorage=false, adUserData=false, adPersonalization=false)
      [USERCENTRICS][DEBUG] [Mediation] Applied Granular Consent to Firebase (Adjust Signal) - MediationGranularConsent(eea=true, analyticsStorage=false, adStorage=false, adUserData=false, adPersonalization=false)
      
    • Note: the "Adjust Signal" will only be printed in case Adjust is also properly configured. The Payload is the same for Firebase signal, but only the mentioned flags above will apply for Adjust.
  • How to double check the integration with Firebase?

    • Check out their documentation on how to verify consent signals, iOS or Android.
  • What happens in locations where the SDK is initialized, but end-user consent is not required?

    • When Usercentrics is properly integrated into your app or game, the banner will not appear in these locations. Consequently, the default consent status for all Services, Vendors, and Purposes will be positive. As a result, we will signal granted consent for all the flags mentioned above, for Firebase and Adjust SDKs.

Integration on Earlier Versions

Usercentrics implemented the Google Consent Mode in version 2.11.0. For the sake of transparency, we offer a link that documents how the integration was conducted in that version. 🎉