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.
- Consent check overview
- Google Analytics for Firebase SDK
- Implement Google Consent Mode 2.0 on mobile
- Test integration
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:
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).
Enable Advanced Setting flag
Once the Google vendors are added to the vendor list, click Advanced Settings.
Enable the checkbox for Use TCF to Enable Google Consent Mode 2.0. Click Apply Changes when finished.
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 |
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.
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.
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.
Set the legal basis for the custom purpose to User Consent.
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)
}
As an alternative to the preferred method of implementing Google Consent Mode 2.0 on your mobile property running a GDPR TCF campaign, your organization can perform the following:
- Add Google Product vendors to vendor list
- Configure custom purposes for Google consent checks
setConsent
method in app
Add Google Product vendors to vendor list
From the GDPR TCF vendor list associated with your mobile property, your organization most likely want to add the following vendors:
- Google Advertising Products (GV: ID 755)
- 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).
Configure custom purposes for Google consent checks
Your organization will need to create a custom purpose in your GDPR TCF vendor list that maps to the consent checks used by the Google product(s) running on your property.
analytics_storage
(required when using Google Analytics for Firebase SDK)ad_storage
ad_user_storage
ad_personalization
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 to select a consent type to which this custom purpose will map. Click Create purpose when finished.
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.
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.
Set the legal basis for the custom purpose to User Consent.
Repeat as necessary for other consent types used by Google products on your property.
setConsent
method in app
Ensure that you are utilizing the setConsent method in your mobile app to update all the Google consent checks used by your Google products.
//iOS example
func onSPFinished(userData: SPUserData) {
let gcmData = userData.gdpr?.consents?.googleConsentMode
Analytics.setConsent([
.analyticsStorage: gcmData?.analyticsStorage == .granted ? .granted : .denied,
.adStorage: gcmData?.adStorage == .granted ? .granted : .denied,
.adUserData: gcmData?.adUserData == .granted ? .granted : .denied,
.adPersonalization: gcmData?.adPersonalization == .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,
ConsentType.AD_STORAGE to if(gcmData?.adStorage == GCMStatus.GRANTED) ConsentStatus.GRANTED else ConsentStatus.DENIED,
ConsentType.AD_USER_DATA to if(gcmData?.adUserData == GCMStatus.GRANTED) ConsentStatus.GRANTED else ConsentStatus.DENIED,
ConsentType.AD_PERSONALIZATION to if(gcmData?.adPersonalization == 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.
Add the following arguments under Arguments Passed on Launch:
-FIRAnalyticsVerboseLoggingEnabled
-FIRAnalyticsDebugEnabled
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
Comments
0 comments