Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is valid add npa 0 in bundle extras for personalized ads in consent SDK admob?

Tags:

android

admob

I hope you are well.

Is valid adding npa 0 in the bundle to request personalized ads or we need to make another object for this?

According to the documentation what it says here Forward consent to the Google Mobile Ads SDK

This is for request non-personalized ads

Bundle extras = new Bundle();
extras.putString("npa", "1");
AdRequest request = new AdRequest.Builder()
        .addNetworkExtrasBundle(AdMobAdapter.class, extras)
        .build();

According to the documentation it says:

If non-personalized ads are requested, the ad request URL currently includes &npa=1. However, note that this is an internal implementation detail of the Google Mobile Ads SDK and is subject to change.

If i want to request personalized ads i can put 0?

Bundle extras = new Bundle();extras.putString("npa", "0");

Thanks in advance

like image 965
Quimbo Avatar asked Oct 16 '22 10:10

Quimbo


1 Answers

If you want to request personalized ads, there is no need to use addNetworkExtrasBundle().

Simply use,

AdRequest.Builder builder = new AdRequest.Builder();
if (/*Request non-personalized ads*/) {
    Bundle extras = new Bundle();
    extras.putString("npa", "1");
    builder.addNetworkExtrasBundle(AdMobAdapter.class, extras);
}
AdRequest request = builder.build();
like image 147
Saurabh Thorat Avatar answered Nov 02 '22 07:11

Saurabh Thorat