Requesting ads in specific categories

104 views
Skip to first unread message

Asaf Pinhassi

unread,
Nov 18, 2014, 9:26:30 AM11/18/14
to google-adm...@googlegroups.com
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.

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Nov 19, 2014, 8:37:37 PM11/19/14
to google-adm...@googlegroups.com
Hi Asaf,

Which product are you signed up for? I'm guessing AdMob.

SearchAdView is enabled for a subset of apps that naturally accept a search query in their app (example: yelp). If your ad unit ID starts with ca-app-pub, you aren't using the search ads product anyways, so these categories won't help.

PublisherAdView is used by DoubleClick for Publishers (DFP) users. These users define their own category labels in the DFP UI, and would know which categories to target. It sounds like you aren't using DFP either.

For AdMob, the way to enable/disable categories is done in the front end. There are more instructions on that here.

Thanks,
Eric

mr.serious

unread,
Dec 9, 2014, 12:01:39 PM12/9/14
to google-adm...@googlegroups.com
Hi Eric,

I'm actually landed here while googing information for really similar use case.

I would like to one have an adUnit ant target creatives by category.

You have mentioned "category labels in the DFP UI".
Could you please expand on this or point me to the right read.

Thanks a lot!

Eric Leichtenschlag (Mobile Ads SDK Team)

unread,
Dec 10, 2014, 1:28:58 PM12/10/14
to google-adm...@googlegroups.com
Here is more information about category labels in DFP.

Claes-Fredrik Mannby

unread,
Aug 9, 2016, 10:21:28 PM8/9/16
to Google Mobile Ads SDK Developers
Is there a way to specifically request SearchAdView enablement?
Reply all
Reply to author
Forward
0 new messages