I faced a strange behavior while testing new GDPR consent message in my app:
When user clicks the "Consent options" button and turns off all the toggles, app still gets consentInformation.canRequestAds() == true
, but Ads always fails to load.
Here is my consent form implementation (directly from the Google's sample):
private fun showAdsContestIfNeeded() {
val params = ConsentRequestParameters
.Builder()
.build()
consentInformation = UserMessagingPlatform.getConsentInformation(this)
consentInformation.requestConsentInfoUpdate(
this,
params,
{
UserMessagingPlatform.loadAndShowConsentFormIfRequired(
this@GameActivity
) { loadAndShowError ->
if (consentInformation.canRequestAds()) {
initializeMobileAdsSdk()
}
}
}, { requestConsentError ->
})
if (consentInformation.canRequestAds()) {
initializeMobileAdsSdk()
}
}
private fun initializeMobileAdsSdk() {
if (isMobileAdsInitializeCalled.getAndSet(true)) {
return
}
MobileAds.initialize(this)
}
After that app can load different Ads in the app, here is a sample for the rewarded ad:
val adRequest = AdRequest.Builder().build()
RewardedAd.load(
context,
getRewardAdId(context),
adRequest,
callback)
While loading rewarded Ad, the logs are showing the following lines:
Ad failed to load : 3
Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:234310602
Selected remote version of com.google.android.gms.ads.dynamite, version >= 234310602
My questions are:
- Can app still show ads if user turned off all the toggles in the consent form (non-personalized Ads)?
- I am missing something in the AdMob + Consent Form integration?
- If the answer to the first question is "No", then why app is getting the
canRequestAds() == true
flag ?
Also, Ads are working fine if I click "Consent" in the form without managing it's options
Update #1:
Looks like Google is being Google and rolls out a GDPR contest library which is not filling all the possible flows. The devs that are using Admob to monetize their app are locked by using Google lib or any other lib that is Google certified. From my understanding, the only possible solution is to switch from Admob to the normal Ad-serving platform.