Hi,
I try to get ads from specific categories on Android and I have a few questions;
Q1. I always get an ad, not specifically related to the category I put. How can I tell that it actually works?
I tried the following implementation:
Using SearchAdView -
mAdView = new SearchAdView(this);
mAdView.setAdUnitId(getString(R.string.ad_unit_id));
mAdView.setAdSize(AdSize.SMART_BANNER);
// Create an ad request.
SearchAdRequest.Builder searchAdRequestBuilder = new SearchAdRequest.Builder();
searchAdRequestBuilder.setQuery("flower");
SearchAdRequest request = searchAdRequestBuilder.build();
// Add the SearchAdView to the view hierarchy.
adWrapper.addView(mAdView);
mAdView.loadAd(request);
Q2. on the SearchAdView implementation, what should the query look like for multiple words?
For example: setQuery("flower, travel, music"); or setQuery("flower AND travel AND music"); or setQuery("flower travel music");
Using PublisherAdView-
mAdView = new PublisherAdView(this);
mAdView.setAdUnitId(getString(R.string.ad_unit_id));
mAdView.setAdSizes(AdSize.SMART_BANNER);
adWrapper.addView(mAdView);
Bundle extras = new Bundle();
extras.putString("main_cat", "travel");
extras.putString("excl_cat", "mercedes,jaguar,lexus"); // for additional categories, use a comma separated list. i.e. "mercedes,jaguar,lexus"
PublisherAdRequest request = new PublisherAdRequest.Builder()
.addNetworkExtras(new AdMobExtras(extras))
.addTestDevice("6B279A05585B24A821D64CC0C712BF03")
.build();
// Start loading the ad.
mAdView.loadAd(request);
Q3. on the PublisherAdView implementation, what should the query look like for multiple categories?
Thanks,
Asaf.