Category Archives: Google Ads Developer Blog

The blog for information about the AdWords, AdSense, DoubleClick and AdMob APIs and SDKs.

Shopping utility available in the AdWords API Java client library

We've got good news for Java developers using the AdWords API to manage Shopping campaigns: the Java client library now has a set of utilities that greatly simplifies the process of setting up your product partition trees.

The utilities let you focus on your use case, avoid boilerplate code, make your code more readable, and reduce the amount of code needed for common actions.

For example, the updated AddProductPartitionTree code sample that uses the utility is 65% shorter than the previous version.

Intrigued? Check out the product partition utility guide on github, and let us know what you think!

If you would like to have a similar utility in a different client library, register your interest by opening a github issue on that library's issues page.

Learn more

If you haven't started using Shopping campaigns, the following resources are a great place to start: Still have questions? Feel free to visit us on the AdWords API Forum or our Google+ page.

Announcing v7.0 of the Google Mobile Ads SDK for Android

Today we’re announcing the release of v7.0 of the Google Mobile Ads SDK! It’s listed as Google Play services (Rev. 23) in the Android SDK manager, and is available for download right now. Those of you using Android Studio can download Google Repository (Rev. 16) to get the latest Gradle artifacts. This release contains a number of stability and performance improvements, as well as some new features.

DFP developers can take advantage of two other new methods in PublisherAdRequest.Builder: addCustomTargeting and addCategoryExclusion.

Previously, developers had to add custom targeting information to a request by creating a Bundle and passing it to addNetworkExtrasBundle. This can now be done with a simple call to the addCustomTargeting method:


PublisherAdRequest newRequest = new PublisherAdRequest.Builder()
.addCustomTargeting("some_key", "some_value")
.addCustomTargeting("some_other_key", aListOfStringValues)

.build();

The new addCategoryExclusion method makes setting a slot-level category exclusion label for a request just as straightforward:


PublisherAdRequest newRequest = new PublisherAdRequest.Builder()
.addCategoryExclusion("some_unwanted_category")
.addCategoryExclusion("some_other_unwanted_category")

.build();

Another new feature is the setRequestAgent method that’s been added to AdRequest.Builder and PublisherAdRequest.Builder. Third party libraries that reference the Mobile Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a third-party ad network called "CoolAds" mediates requests to the Mobile Ads SDK, it should call this method with "CoolAds":


AdRequest newRequest = new AdRequest.Builder()
.setRequestAgent("CoolAds")
.build();

This SDK release coincides with version 7.0 of Google Play services, which was recently announced on the Android Developer blog. For a full list of Mobile Ads SDK changes, check out our release notes. For technical questions, post them on our forum.