I use the UMP to obtain user consent. And then I want to show ads with Google AdMob. In the UMP documentation the part "Forward consent to the Google Mobile Ads SDK" exists. According to this I can choose if AdMob should show personalized ads or non-personalized ads:
Bundle extras = new Bundle();
extras.putString("npa", "1");
AdRequest request = new AdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
.build();
But how do I get the information if the user Accepted ("Consent") or Rejected ("Do not consent") the consent form? How do I know if I should show personalized ads or non-personalized ads? Or should I add another button in my app asking what kind of ads the user wants to see?
The only information I get with UserMessagingPlatform.getConsentInformation
is if the user already has chosen "Consent" or "Do not consent" (if the status == Obtained) but not what option he selected.
You don't need to forward this information to admob, the SDK itself takes care of it. However:
You need for both - personalized ads or non-personalized ads - consent from the user. In the old Consent SDK, the user could choose between giving consent to personalized ads (by clicking YES), and giving consent to non-personalized ads (by clicking NO). The new UMP SDK seems to be different. The user can easily choose to give no consent at all. Then, this is my understanding, no ads will be shown. I think the user can choose to receive non-p ads, but it's quite complicated, there are many options. It's easier to just click NO CONSENT.
You could check if ads are shown, and if they are not, then request non-personalized ads – which I suspect should be shown. However, you should first get consent from the user. In the UMP documentation you mentioned to use
putString("npa", "1");
, it says:In the new UMP SDK, if the user clicks no consent, you have no consent, even not for non-personalized ads.