Google Consent Mode V2 debug view The log printed by LogCat does not have ad_personalization related fields
Google Consent Mode V2 debug view in the log printed by LogCat only Setting consent, ... ad_storage=denied/granted Setting consent, ... analytics_storage=denied/granted Some devices do not have fields related to ad_user_data and ad_personalization. Some devices just don’t have ad_personalization related fields.
Official documentation: https://developers.google.com/tag-platform/security/guides/app-consent?platform=android
<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" />
public void setConsent() {
// Set consent types.
Map<FirebaseAnalytics.ConsentType, FirebaseAnalytics.ConsentStatus> consentMap = new EnumMap<>(FirebaseAnalytics.ConsentType.class);
consentMap.put(FirebaseAnalytics.ConsentType.ANALYTICS_STORAGE, FirebaseAnalytics.ConsentStatus.GRANTED);
consentMap.put(FirebaseAnalytics.ConsentType.AD_STORAGE, FirebaseAnalytics.ConsentStatus.GRANTED);
consentMap.put(FirebaseAnalytics.ConsentType.AD_USER_DATA, FirebaseAnalytics.ConsentStatus.GRANTED);
consentMap.put(FirebaseAnalytics.ConsentType.AD_PERSONALIZATION, FirebaseAnalytics.ConsentStatus.GRANTED);
mFirebaseAnalytics.setConsent(consentMap);
}
I just had a conversation with a Google engineer and he told me we need to check the next property on logs:
where
0means "GRANTED" and1"DENIED"It's very confusing and the documentation doesn't explain it but if you test your implementation you will see how the value changes.