Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How can category exclusion labels be sent to DfP?

149 views
Skip to first unread message

Kotan

unread,
Jul 10, 2014, 4:20:39 PM7/10/14
to google-adm...@googlegroups.com
We're using the Google Mobile Ads SDK on Android and iOS in combination with a DfP server.  We've successfully implemented ad display including targeting information sent to DfP. To complete the apps, we would need to send category exclusion labels to DfP as well. However, I can't figure out how to implement it. There doesn't seem to be any documentation about it.

Basically, we want to achieve the equivalent of the following Javascript code used on our web site and cannot find the SDK call for setCategoryExclusion:

googletag.cmd.push(function() {
  googletag
.defineSlot('/123456/sky', [[728, 90]], 'div-gpt-ad-1234567890-0')
     
.addService(googletag.pubads()).setTargeting("main_cat", "cars");
  googletag
.pubads().setCategoryExclusion('Mercedes');  
  googletag
.enableServices();
});

Eric Leichtenschlag

unread,
Jul 10, 2014, 8:09:04 PM7/10/14
to google-adm...@googlegroups.com
Hello,

Setting category exclusions currently isn't available in the SDK, but I'll note this as a feature request to enable targeting options like this one on the PublisherAdRequest.

Thanks,
Eric

Kotan

unread,
Jul 11, 2014, 2:07:59 AM7/11/14
to google-adm...@googlegroups.com
Hi Eric

Thanks for the answer. Hopefully, it will be available soon.

Regards
Kotan

Eric Leichtenschlag

unread,
Jul 25, 2014, 2:47:37 PM7/25/14
to google-adm...@googlegroups.com
Hi Kotan,

It turns out I was wrong, there is a way to do this in the current SDK. This is done the same way as custom targeting, but with the special "excl_cat" key. So in your case, your ad request code might look like this:

Bundle extras = new Bundle();
extras.putString("main_cat", "cars");
extras.putString("excl_cat", "mercedes"); // for additional categories, use a comma separated list. i.e. "mercedes,jaguar,lexus"
    
PublisherAdRequest request = new PublisherAdRequest.Builder()
    .addNetworkExtras(new AdMobExtras(extras))
    .build();

We still have an open feature request to have first class methods for setTargeting and setCategoryExclusion on PublisherAdRequest.Builder to make this match up with the Google Publisher Tags API.

Thanks,
Eric

Kotan

unread,
Jul 25, 2014, 3:45:35 PM7/25/14
to google-adm...@googlegroups.com
Hi Eric

Thank you very much. That's a solution I can implement quickly.

-- Manuel
Reply all
Reply to author
Forward
0 new messages