Category Archives: Google Ads Developer Blog

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

New AdWords API guides

Did you know we have an extensive set of themed guides on the AdWords API Developers site? We do our best to have every topic covered and to keep all of them up-to-date. If you find that particular functionality needs better coverage, or we have a gap on a certain topic, let us know!

Meanwhile, my colleagues have published five new guides for the AdWords API:

We are looking forward to hearing your feedback via our G+ page or on the forum.

AdWords and DoubleClick Ad Exchange API users – Only 3 weeks left to migrate from ClientLogin to OAuth 2.0!

ClientLogin authentication support for the AdWords API and the DoubleClick Ad Exchange API will sunset along with v201309 on July 21st, 2014. You only have 3 weeks left to migrate!

We have plenty of resources to help you migrate. It might take longer than you expect to migrate to OAuth 2.0, especially if you don't already use a single top-level MCC to manage your AdWords accounts or if you are a DoubleClick Ad Exchange customer.

Start your migration as soon as possible and reach out to us early on the AdWords API Forum or the DoubleClick Ad Exchange API Forum with any questions.

AdWords API – Using CONVERSION DURATION THRESHOLD feed placeholder will throw errors

The CONVERSION DURATION THRESHOLD placeholder was deprecated on April 28th, 2014. Starting July 21st, 2014, using this placeholder with the FeedMappingService will result in a FeedMappingError.INVALID_PLACEHOLDER_FIELD error for all AdWords API versions.

See this post for details on how to set your conversion duration going forward with the CONVERSION TYPE ID placeholder instead.

If you have any questions about this upcoming change or anything else related to the AdWords API, please contact us on the AdWords API forum or via the Google Ads Developers Google+ page.

Announcing New Google Mobile Ads SDK for Android

We're enthused to announce a new version of our Mobile Ads SDK for Android.

Our big change for this version are our new Custom Event APIs. After updating our mediation APIs in our last release, Custom Events were up for a refresh. Our new-and-improved Custom Event APIs make it even easier to implement your own mediation adapter or show a custom view in your ad space.

Remember that after August 1st the Play Store will no longer accept submissions using the legacy SDK, so please update your apps to use the latest version of Google Play Services.

For a full list of SDK changes, check out our release notes. For technical questions, post them on our forum. We're stoked about these improvements, and hope you find them useful!

New entity child limits in DFP

As part of our ongoing efforts to improve DFP's performance and stability, we will be introducing limits on select DFP items, beginning June 30, 2014. As an API user, here’s how this change will affect you.

If you create more children than the allowed maximum for an entity, or modify an existing entity so that its number of children exceeds those limits, the API will throw an EntityChildrenLimitReachedError. Refer to the error’s reason field for an explanation for each type of entity that exceeds a child limit. The best way to handle this situation is to catch ApiException errors in your code, check the error type, and perform whatever is appropriate for your application based on the reason.

For a more detailed example of best practices with ApiException errors, please see this blog post on troubleshooting and error handling.

As always, if you have any suggestions or questions, feel free to drop us a line on our API forums or Ads Developer Google+ page.

Filtering away archived line items in the DFP API

If you synchronize your line items regularly to a local database using the LineItem.getLineItemsByStatement method, you are hopefully already filtering by LineItem.lastModifiedDateTime and using our other best practices. We want to mention one other best practice that will help you synchronize your line items as quickly as possible.

Recently, DFP has begun to auto-archive old orders. This affects the lastModifiedDateTime field of the line items in the orders. This means that you may suddenly get significantly more line items in one day’s synchronization than in the previous day’s depending on how many orders were auto-archived since your last synchronization. To prevent this, we recommend always filtering by isArchived. For example:

  WHERE lastModifiedDateTime >= '2014-06-01T00:00:00' AND isArchived = false

As always, if you have any suggestions or questions, feel free to drop us a line on our API forums or Ads Developer Google+ page.

Announcing the v201405 release of the DFP API

Today, we launch v201405 of the DFP API. This release brings better OAuth2 standards, consolidates line item goal information, and adds a lot more report fields. A detailed list of these features and what’s changed can be found on our release notes page.

OAuth2, line item goals, and reports

To align better with OAuth2 standards, starting in v201405 we have removed the OAuth2 SOAP object. This means that you can no longer pass OAuth2 authentication information through the SOAP header. Instead, you pass it in the HTTP header. All of our client libraries have already been updated to follow this process. If your integration is not using one of our client libraries, please be aware of this change when you upgrade to v201405.

We’ve heard your feedback that the line item goal fields such as unitsBought can be confusing. In this version, we have moved line item goal-related fields into their own object, called Goal. This makes it easier to understand and find line item goal information. For example, previously line item goal information would be set as follows (using the PHP client library):

  $lineItem->unitsBought = 500000;
$lineItem->unitType = 'IMPRESSIONS';

Now this goal information is stored in its own object:

  $goal = new Goal();
$goal->units = 500000;
$goal->unitType = 'IMPRESSIONS';
$lineItem->primaryGoal = $goal;

We’ve also heard your feedback regarding parity between the ReportService and the UI in terms of what dimensions, attributes, and columns are available when running a report. In v201405, we make available a whole slew of new report fields, including Gross Rating Points (GRP), business intelligence, shared selling, and SDK mediation dimensions and columns.

Increased quota for premium networks

Although not specific to v201405, the quota for premium networks has been raised. This means that if you want to limit your requests locally, we now recommend at most 8 requests per second for premium networks. For small business networks, we continue to recommend making at most 2 requests per second. As always, limiting your requests does not guarantee that all your requests will succeed, but will help mitigate quota errors. You should still be writing code to handle EXCEEDED_QUOTA errors. For more information about exception handling and recovery, please refer to this blog post.

Much deprecation, wow, so deprecated

We want to remind you that with each new version release, we’ll also be deprecating a number of older versions. Versions v201206 and earlier have now been turned off. All requests made against those versions will fail. Our next wave of versions to be turned off are v201302, v201211, and v201208. This will occur on August 1, 2014. For more information on this deprecation and what resources are available for migrating to the latest version, please see this blog post.

As always, if you have any suggestions or questions about the new version, feel free to drop us a line on our API forums or Ads Developer Google+ page.

The new, improved Content API for Shopping

Since its launch in 2010, the Google Content API for Shopping has played a critical role in enabling merchants to manage product items, users, and subaccounts programmatically at scale. We’ve received a lot of feedback from you over the years, and today, we’re happy to announce a new version of this API.

The Content API version 2:

  • introduces new core functionality, including item-level data quality information, simple inventory updates, and additional account management features
  • is easier to use thanks to high quality client library support, improved tooling, reference documentation and integration with Google’s common API infrastructure
  • has simplified request and response message formats, and now also supports JSON in addition to XML encoding

Version 2 of the API constitutes a big overhaul and we’re eager for you to try it! Version 1 of the API will continue to be available until the end of February 2015, but we recommend that you adopt the new version as early as possible to take advantage of its new and improved features.

New core functionality: Data quality, inventory and account management

In version 2 of the API, you can request full data quality reporting for the whole account as well as item-level information like disapprovals due to incorrect prices or unavailable landing pages.

The inventory service lets you update price and availability of any product without resubmitting other product details.

All existing account management features, such as linking AdWords accounts, adding authorized users, and updating settings are now available for all account types.

Client libraries, better tooling and more

If you don’t want to parse JSON or XML yourself, check out the client libraries for .NET, Dart, Go, Java, JavaScript, Objective-C, PHP, Python and Ruby. The libraries use OAuth 2.0 authorization and work with the Content API as well as many other Google APIs.

The standard Google API tools such as the API console support Content API version 2 out of the box. Additionally, in our API reference documentation, you can now scroll down to the bottom of any reference page to try the API. You can also visit the standalone API Explorer to browse a list of supported operations.

Simplified message formats

The new XML format is lighter than in version 1 of the API. JSON, which is both simpler to work with and uses fewer bytes to transfer the same data, is also supported in version 2.

Learn more

If you would like to learn more about the Content API version 2 you can check out the API documentation. We’ve also prepared a few code examples in PHP and Java if you would like to dive in straight away.

If you have any other questions or comments, please head over to our support forum.

Updated DoubleClick Ad Exchange Buyer REST API examples to get you started

Whether you’re just starting out with the DoubleClick Ad Exchange Buyer REST API or are working with an unfamiliar client library, our examples will help you get started! Our examples are now on GitHub and have been expanded to cover the following languages:

Each of these include documentation to help you get started with the corresponding client library and demonstrate how you can use the Service Account authorization flow with the DoubleClick Ad Exchange Buyer REST API.

If you have any feedback or feature requests for these examples, we’d definitely be interested in hearing about it! Feel free to contact us via the forum or our Google+ page.

Changes to the IMA SDK for iOS

The IMA SDK for iOS version beta7 will introduce some changes in the way you tell the SDK about your display area and companion slots, which lays the groundwork for more versatility in displaying ads. While these new, more versatile features aren’t quite ready yet, we recommend building with beta7 so you'll be prepared to take advantage of upcoming greater versatility and extending support to future iOS platforms.

Introducing the IMAAdDisplayContainer

In the beta6 version of the SDK, the IMAAdsManager contains an adView which you add to your UI to display ads (IMAAdsManager.adView). In the beta7 version of the SDK, you will provide the SDK with a UIView in which it will display ads when they are ready. This is done via the new IMAAdDisplayContainer. This new object will also contain information about your companion ad slots (but more on that later):

  self.adDisplayContainer = [[IMAAdDisplayContainer alloc]
initWithAdContainer:self.videoView
companionSlots:nil];

In the example, we use the videoView as the UIView for the ad container. The SDK simply adds views to the provided UIView to display ads, so you won’t lose the required components for the content player already in the videoView. This IMAAdDisplayContainer will be passed to the IMAAdRequest, in place of the current companionSlots parameter:

  IMAAdsRequest *request =
[[IMAAdsRequest alloc] initWithAdTagUrl:self.adTagUrlTextField.text
adDisplayContainer:self.adDisplayContainer
userContext:nil];

Changes to the IMACompanionAdSlot

In the beta6 version of the SDK, you provide the IMAAdsRequest with an NSArray of IMACompanionSlot objects, each of which is initialized with a width and height. When ads are loaded, you add these to your UI:

  // Create your companion slots.
NSMutableDictionary *companions = [NSMutableDictionary dictionary];
companions[@"300x50"] =
[[IMACompanionAdSlot alloc] initWithWidth:300 height:50];
self.companionSlots = companions;

...

// Give the companion slots to the IMAAdsRequest.
IMAAdsRequest *request =
[[IMAAdsRequest alloc] initWithAdTagUrl:self.adTagUrlTextField.text
companionSlots:[self.companionSlots allValues]
userContext:nil];

...

// Once ads have been loaded, display the companion ads.
[self.smallCompanionSlot addSubview:
((IMACompanionAdSlot *)self.companionSlots[@"300x50"]).view];
In the beta7 version of the SDK, you will initialize the IMAAdDisplayContainer with an array of companion ad slots. You will then initialize the IMAAdsRequest with the IMAAdDisplayContainer. When ads are loaded, the SDK will fill in the companions for you:
  // Create your companion slots.
NSMutableDictionary *companions = [NSMutableDictionary dictionary];
companions[@"300x50"] =
[[IMACompanionAdSlot alloc] initWithView:self.smallCompanionSlot
width:300
height:50];
self.companionSlots = companions;

// Give the companion slots to the IMAAdDisplayContainer.
self.adDisplayContainer = [[IMAAdDisplayContainer alloc]
initWithAdContainer:self.videoView
companionSlots:[self.companionSlots allValues]];

// Request ads with the IMAAdDisplayContainer.
IMAAdsRequest *request =
[[IMAAdsRequest alloc] initWithAdTagUrl:self.adTagUrlTextField.text
adDisplayContainer:self.adDisplayContainer
userContext:nil];

These changes will allow for continued support of YouTube-hosted ads (including TrueView), as well as allow you to provide a custom player for ads further down the road, similar to the HTML5 custom playback option. A custom ad player is not intended to be used by everyone - in fact most of you will not need it - but it will offer support for some additional features in the future.

As always, if you have any questions feel free to contact us via the support forum.