I am using MoPub to show AdMob ads and I need to understand how to properly configure the SDK to pass the consent to the adapters.
For MoPub own ads I use the consent screen provided by Mopub, but they state that the do not collect the consent for AdMob ads. So I need to show an additional consent screen (maybe with Google's Consent SDK if and when it will be available) to get that consent. Up to this everything is ugly but more or less clear.
The question is how I can pass the consent to the AdMob adapter in Mopub SDK. Reading the documentation from AdMob I need to follow these instructions:
The default behavior of the Google Mobile Ads SDK is to serve personalized ads. If a user has consented to receive only non-personalized ads, you can configure an AdRequest object with the following code to specify that only non-personalized ads should be returned:
Bundle extras = new Bundle();
extras.putString("npa", "1");
AdRequest request = new AdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
.build();
It is unclear how I can pass the "npa=1" parameter in the NetworkExtrasBundle to the AdMob adapter in Mopub SDK. The GooglePlayServicesBanner
class in the SDK seems to be not able of configuring none of those extras.
Is patching the adapter the only way of passing the parameter?
Edit: This has been fixed in the meantime in latest adapter and now it is possible. See the docs.