Google Consent Mode 2.0 (GDPR TCF - mobile)

   Permission: Vendor list - GDPR

Google Consent Mode 2.0 ensures that Google vendors on your property comply with an end-user's consent choices for purposes (called consent checks) defined by Google. When a mobile app user indicates their consent choices, tags with consent checks adjust their behavior, and user consent choices are preserved across their interaction with the mobile app.

In this article, we will cover how to configure the integration between Sourcepoint and Google Consent Mode 2.0 for a mobile property that is running a GDPR TCF campaign.  

  Note: Be advised that Google Consent Mode 2.0 only impacts your organizations if you use one or more of the following Google products:

  • Google Ads
  • Google Analytics
  • Search Ads 360
  • Campaign Manager 360
  • Display & Video 360

Consent check overview

Consent check(s) indicates the kind of storage a Google vendor uses.  An end-user can deny or grant the collection of this data. Please refer to the table below for the different consent checks available in Google Consent Mode 2.0:

Consent check Values Description
ad_storage granted | denied Enables storage (such as cookies) related to advertising.
analytics_storage granted | denied Enables storage (such as cookies) related to analytics (e.g. visit duration).
ad_user_data granted | denied Set to granted when end-user has consented to have their data shared with Google. 
ad_personalization granted | denied Set to granted when the user has consented to have their data shared with Google for the purposes of ad personalization.

Google Analytics for Firebase SDK

Google Consent Mode 2.0 utilizes Google Analytics for Firebase SDK for mobile app implementations. To integrate Google Consent Mode 2.0 into your mobile application, your organization will need to set the default consent state for Google consent checks in your app's info.plist file and utilize a setConsent method to update the respective consent checks. Visit our mobile SDKs for more information.

 Sourcepoint mobile SDKs

Implement Google Consent Mode 2.0 on mobile

Sourcepoint supports two different ways to implement Google Consent Mode 2.0 on your property running a GDPR TCF campaign. Click the tabs below to review which implementation method is suitable for your organization:

GDPR TCF (Preferred) GDPR TCF (no flag)

The preferred method of implementing Google Consent Mode 2.0 on your mobile property requires enabling an Advanced Setting flag in your GDPR TCF vendor list associated with your property. 

  • Add Google Product vendors to vendor list
  • Enable Advanced Setting flag
  • Configure analytics_storage custom purpose
  • setConsent method in app

Add Google Product vendors to vendor list

From the GDPR TCF vendor list associated with your mobile property, add the following vendors:

  • Google Advertising Products (GV: ID 755) - required for this implementation method
  • Google Firebase 

Additionally, your organization my add other custom vendors to your vendor list that best represent your Google product usage (e.g. Google Analytics).

Screenshot 2024-02-14 at 9.40.26 AM.png


Enable Advanced Setting flag

Once the Google vendors are added to the vendor list, click Advanced Settings.

Screenshot 2024-02-05 at 12.59.12 PM.png

Enable the checkbox for Use TCF to Enable Google Consent Mode 2.0. Click Apply Changes when finished. 

Screenshot 2024-02-08 at 10.48.24 AM.png

Save your vendor list to confirm the changes. 

The Use TCF to Enable Google Consent Mode 2.0 setting enables Sourcepoint to set an additional flag when initializing the TCData object. This additional flag allows Google to infer and map consent settings to the following Google Consent Mode 2.0 consent checks based on GDPR TCF purposes:

  • ad_storage
  • ad_personalization
  • ad_user_data

Please see the table below for how Google Consent Mode 2.0 maps GDPR TCF purposes to Google's consent checks:

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.

9 Apply market research to generate audience insights Disables the Google signals feature in Google Analytics.
10 Develop and improve products Disables the Google signals feature in Google Analytics.

Configure analytics_storage custom purpose

Your organization will need to create a custom purpose in your GDPR TCF vendor list that maps to the analytics_storage consent check used by the Google product(s) running on your property. Since Google Consent Mode 2.0 is deployed via Google Analytics for Firebase SDK, creating this custom purpose is required. 

  Note: You will need to create a custom purpose for analytics_storage but you do not need to create a custom purpose for ad_storage since that consent check will be set via the Use TCF to Enable Google Consent Mode 2.0 flag you configured earlier.

Click + Add Custom Purpose from the vendor list builder page. Use the provided modal to input a name for the custom purpose. 

Use the Google Consent Mode Category dropdown menu and select analytics_storage. Click Create purpose when finished.

Screen_Shot_2022-06-30_at_1.24.25_PM.png

As a best practice, Sourcepoint recommends that you describe the Google products that currently rely on the purpose.

Navigate to the newly created custom purpose and click the custom purpose name.

Screenshot 2024-02-05 at 3.54.36 PM.png

Use the provided description field to note the Google products utilizing the custom purpose as part of the Google Consent Mode integration. Click Apply changes when finished.

Screenshot 2024-02-05 at 3.56.07 PM.png

Set the legal basis for the custom purpose to User Consent

Screenshot 2024-02-05 at 3.57.32 PM.png

Click Save to confirm the updates to your vendor list. Your Sourcepoint and Google Consent Mode 2.0 integration setup is complete. 


setConsent method in app

Ensure that you are utilizing the setConsent method in your mobile app to update the Google consent check specifically for analytics_storage. Since the Use TCF to Enable Google Consent Mode 2.0 flag will allow Google to infer and map TCF purposes to the relevant Google consent checks, your organization only needs to utilize the setConsent method for analytics_storage.

//iOS example
func onSPFinished(userData: SPUserData) {
    let gcmData = userData.gdpr?.consents?.googleConsentMode
    Analytics.setConsent([
        .analyticsStorage: gcmData?.analyticsStorage == .granted ? .granted : .denied,
    ])
} 
//Android example
override fun onSpFinished(sPConsents: SPConsents) {
            // Set consent types.
            val gcmData = sPConsents.gdpr?.consent?.googleConsentMode
            val consentMap = mapOf(
              ConsentType.ANALYTICS_STORAGE to if(gcmData?.analyticsStorage == GCMStatus.GRANTED) ConsentStatus.GRANTED else ConsentStatus.DENIED
            )
            mFirebaseAnalytics.setConsent(consentMap)
        }            
          

Test integration

In order to test that the correct consent checks are being passed to the Google Firebase SDK when the appropriate  purposes are consented/rejected, Sourcepoint suggests that you enable verbose logging on your device. 

In Xcode, select Product > Scheme > Edit Scheme.

From the subsequent modal, select Run from the left-hand panel and then navigate to the Arguments tab.

Screenshot 2024-02-13 at 9.12.45 AM.png

Add the following arguments under Arguments Passed on Launch:

  • -FIRAnalyticsVerboseLoggingEnabled
  • -FIRAnalyticsDebugEnabled

Screenshot 2024-02-13 at 9.11.33 AM.png

Run your app and events will display in the Xcode debug console. Search for any of Google consent checks in the console to see how the consent checks are being set.

  Note: Please be aware that if you using the Preferred method of implementing Google Consent Mode 2.0 (i.e. utilizing the Use TCF to Enable Google Consent Mode 2.0 setting) then ad_storage, ad_user_data, and ad_personalization consent check values will not be passed to the following:

  • iOS: userData.gdpr?.consents?.googleConsentMode
  • Android: sPConsents.gdpr?.consent?.googleConsentMode

Screenshot_2024-02-13_at_9_40_23 AM.jpg

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.