Category Archives: Google Ads Developer Blog

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

Generating the Snippet Status Report with Ad Exchange Buyer REST API

If you are running DoubleClick Ad Exchange Real-Time Bidding campaigns, you can now use the Snippet Status Report Generator to obtain a Snippet Status Report for your creatives. The Snippet Status Report contains the approval status of your creatives, as well as the sensitive and product categorization that Ad Exchange automatically detects. The Snippet Status Report Generator produces reports using the Ad Exchange Buyer REST API.

There are three versions of this report available through the generator: a human readable text format, a binary protocol buffer format, and a spreadsheet-friendly CSV format. The text and protocol buffer version of the report can also be obtained via Google Cloud Storage. The CSV version can be used with spreadsheet programs such as Google Sheets, Microsoft Excel or LibreOffice Calc:

The Snippet Status Report Generator is available on GitHub as a python program. You are encouraged to download it and make modifications to generate reports in your desired format.

If you have any questions or feature requests for the Snippet Status Report Generator, please create an issue on the project’s issues page.

For any questions about the Ad Exchange Buyer API, visit us on the forum or our Google+ page.

Deprecating PHP 5.2 support for the Ads PHP Client Library

Starting January 1st, 2015, the PHP Ads client library will stop supporting PHP 5.2:
  • We will no longer test against PHP 5.2, or fix bugs that only affect PHP 5.2 users
  • Newer versions of the library may not work with PHP 5.2
This will impact PHP client library users of the AdWords API, the DoubleClick for Publishers API, and the DoubleClick Ad Exchange Buyer APIs.

PHP 5.2 hasn’t been supported since 2011 and should be upgraded to a current, stable version. Upgrading ensures you’ll receive the latest security updates.

In addition, there are numerous issues when using the PHP 5.2 SOAP client, such as: In particular, custom HTTP headers are required for the DoubleClick for Publishers API starting from DoubleClick for Publishers API v201405 - the OAuth 2.0 access token must be passed via the HTTP headers rather than the URL parameter. In this case, PHP 5.2 users must upgrade in order to use DoubleClick for Publishers API v201405.

As always, if you have any questions, drop us a line on the forums (AdWords API, DoubleClick for Publishers API, DoubleClick Ad Exchange Buyer API) or Ads Developers Google+ page.

AdWords – Meaningful Return Values

We are always striving to make sure the data you fetch from the AdWords API is as meaningful as possible, and in v201406 we've made a few changes to some return values that should be more intuitive.

First, in the TrafficEstimatorService, we used to return 0 for values which we couldn't calculate, for example if a field requires division by zero. However, this could’ve given the false impression that the actual value was 0, rather than that it couldn't be calculated. For this reason, we’ve changed the logic to return null in cases where the value couldn't be calculated at all. This affects the averageCpc and averagePosition fields in StatsEstimate, as these values will not be returned in SOAP responses when they can’t be calculated.

Second, when using the Keyword Performance Report, we formerly returned all negative keywords as having a "pending review" approval status. Since negative keywords don't need to go through the same process as normal keywords, we will now return a null value instead for the ApprovalStatus field for all negative keywords.

This change only affects version v201406 going forward, and doesn’t affect existing versions v201402 or v201309.

As always, we are constantly looking to improve the API. If you have any questions about this or other API features, please feel free to ask on the forum or on our Google+ page.

Changes to Ads API .NET client library

We have made a few changes to the Ads API .NET client library to allow better maintenance and support.

Unified repository

For ease of maintenance and to reduce duplication, we have combined the AdWords, AdXBuyer, DFP and DFA API .NET libraries into one repository: https://github.com/googleads/googleads-dotnet-lib

Going forward, please use the new repository for downloading Ads API .NET client library releases, reporting issues, requesting features, and providing source contributions.

We have updated wiki articles, consolidated open issues, and imported source code of past releases.

New runtime requirement

We have increased the runtime requirement for the client library to Microsoft .NET Framework 4. This upgrade allows us to enhance the library using features available in newer versions of the Microsoft .NET framework, while moving away from .NET 2.0, which is past its mainstream support period.

In case you are still using Microsoft .NET Framework 2.0, you may continue using the legacy library until July 1st, 2015, at which time we will stop providing bug fixes and enhancements to the library. Major feature enhancements and support of newer versions of the APIs will be limited to the newer library that uses Microsoft .NET Framework 4.

Updates to version numbers

We have updated the version number of the Ads API .NET client library to 18.0.0. The Common library version has been updated to 3.0.0. Going forward, all the API-specific client library assemblies will share a single version number, while the Common library will continue to maintain its own version number.

The legacy library assemblies will only have minor releases, and will use the following versioning scheme on both Github and Nuget:
  • Google.Ads.Common: 2.x
  • Google.AdWords: 17.x
  • Google.Dfp: 7.x
  • Google.Dfa: 5.x
If you have questions or feedback, let us know on our forum or our Google+ page.

A day in the life of a mobile line item (part 1)

Imagine for a moment that you're a mobile line item. You've just been initialized locally, and all of a sudden you’re having an existential crisis -- what makes you, you? How are you different from all the other line items? Sure your associated creative might be a bit different from other line items and you might have a few extra impressions allotted to your goal, but what truly makes you... unique? In this series of posts, we'll take you on an incredible journey through a day in the life of a mobile line item -- from how to target mobile to the actual delivery on a device.

Adding mobile specific targeting

It all starts similarly enough: you need a name, an order ID, start and end dates, a goal, and all the usual suspects -- but wait, there's more! Instead of just having custom criteria, ad units, and geo-targeting, you find that you also have TechnologyTargeting fields specified, like:

  • DeviceCategoryTargeting
  • OperatingSystemTargeting
  • MobileCarrierTargeting

Now, say you're being created as a line item to advertise Android tablet cases. It doesn't make much sense for you to be delivered to an iPad or an iPhone, so we need to add technology specific targeting.

To do so using Java, we would first set the DeviceCategory object with the targeting ID of the 'Tablet' category and the OperatingSystem object with the targeting ID of 'Android', both of which we'd pull from the PublisherQueryLanguage service:

    DeviceCategory deviceCategory = new DeviceCategory();
OperatingSystem operatingSystem = new OperatingSystem();

deviceCategory.setId(30002L);
operatingSystem.setId(501013L);

These would then be set on the DeviceCategoryTargeting and OperatingSystemTargeting objects:

    DeviceCategoryTargeting deviceCategoryTargeting = new DeviceCategoryTargeting();
OperatingSystemTargeting operatingSystemTargeting = new OperatingSystemTargeting();

deviceCategoryTargeting.setTargetedDeviceCategories(new DeviceCategory[] {deviceCategory});
operatingSystemTargeting.setOperatingSystems(new OperatingSystem[] {operatingSystem});

Finally, the Targeting object will have a TechnologyTargeting object set for DeviceCategoryTargeting and also OperatingSystemTargeting:

    TechnologyTargeting techTargeting = new TechnologyTargeting();
technologyTargeting.setDeviceCategoryTargeting(deviceCategoryTargeting);
technologyTargeting.setOperatingSystemTargeting(operatingSystemTargeting);

Targeting targeting = new Targeting();
targeting.setTechnologyTargeting(techTargeting);

Now what happens? You're a line item that has a bit of technology targeting specified, but where are you off to next? Stay tuned for what happens next in - 'A day in the life of a mobile line item, part 2.'

New OAuth 2.0 Scope for the AdWords API

A new OAuth 2.0 scope for the AdWords API was introduced along with the v201406 client library release. The OAuth 2.0 scope identifies the service that your application can access during the authorization process.

The new scope is: https://www.googleapis.com/auth/adwords. This new scope better aligns with the naming conventions of many of the other Google APIs.

Starting today, use the new scope when authorizing access for the AdWords API regardless of the AdWords API version. All our current AdWords API client libraries use this new scope.

But I have refresh tokens from the deprecated scope...

Don’t worry if your client code is using refresh tokens authorized with the deprecated scope - they will still work. However, new authorizations should specify the new scope.

As always, if you have any questions, drop us a line on the AdWords API forum or Ads Developers Google+ page.

New labels features in AdWords API v201406

Many developers in the AdWords API community have mentioned that being able to create, modify, assign, and report on labels through the API would be extremely helpful. Well, we're excited to report that the v201406 release of the AdWords API includes all of these requested features!

Summary of label services and features End-to-end example
So how do these new features work together? Check out our labels guide to get you on the road to AdWords label expertise!

Next steps
If you've never used labels in your account or need a refresher course, check out the Help Center labels guide. Once you're ready to dive in, try out the label examples in your client library of choice.

Still have questions? Feel free to visit us on the AdWords API Forum or our Google+ page.

Announcing v201406 of the AdWords API

Today we’re announcing the release of AdWords API v201406. Here are the highlights:
  • Labels support. The new LabelService now allows you to manage your labels through the API. We've also extended the relevant services to allow setting labels at all levels (campaign, ad group, ad, keyword) and updated reporting to allow labels-based retrieval and filtering.
  • Upgraded URLs. The next generation of destination URLs allow you to specify multiple destination URLs for your ads, criteria and sitelinks. URL templates allow you to change the tracking parameters of your destination URLs without repeatedly reviewing and verifying landing pages. This feature is currently available for test accounts only, but will become generally available soon.
  • Distance targeting. The new LocationExtensionOperand allows you to set a radius around campaign location targets to reach users within the specified area. This will replace legacy Proximity targets in the future.
  • Improved accounts management. ManagedCustomerService now allows you to move whole subtrees between MCCs.
  • Consistency updates. We updated a number of fields and report columns to be more consistent across the API. Make sure to check the release notes for the full list of changes.
Note: ClientLogin authorization protocol is deprecated and is no longer supported in versions v201402 and later. You need to migrate to OAuth2 to use AdWords API v201406 and access these new features.

If you're still using v201309 of the AdWords API, please note that it's being sunset on July 21st, 2014. We encourage you to skip v201402 and migrate straight to v201406. If you're using v201402, be aware it's now marked deprecated and will be sunset on November 6th, 2014.

As with every new version of the AdWords API, we encourage you to carefully review all changes in the release notes and the v201406 migration guide. The updated client libraries and code examples will be published shortly. With this release, we've also updated the Required Minimum Functionality document to include some of the newly added features that are now required in third-party tools. If you have any questions or need help with migration, please post on the forum or the Ads Developers Plus Page.

Changes to Pretargeting for Ad Exchange Buyer RTB Campaigns

DoubleClick Ad Exchange is improving its pretargeting system by creating a new user interface and API resource to configure the inventory your bidder sees. These changes will only impact your RTB campaigns; non-RTB campaigns will continue to be managed as they were before.

Upgrades will begin in mid-July 2014 and all accounts will be upgraded by the end of September 2014. The new functionality has been added to the v1.3 REST API but will be read-only until your account has been upgraded. For additional information, please review the new resource reference and pretargeting guide.

Note that once your account has been upgraded you will still have access to the SOAP API for reporting, budgeting and non-RTB campaigns, but you will no longer be able to use it for pretargeting. If you need the ability to manage your pretargeting settings via the API, then you must use the latest AdX REST API.

If you have questions about these upcoming changes please contact your account manager. For questions about the Ad Exchange Buyer API, check out the Ad Exchange Buyer API forum. Follow our Google+ page for other announcements and updates.

Line item duration issues in the DFP API v201405

At Google, we always want to be transparent with you about changes to our API. We recently announced v201405 of the DFP API, and, in v201405, we consolidated a line item's goal fields into its own Goal object and added the field LineItem.primaryGoal. During this refactor, the LineItem.duration (previous versions) field was removed from LineItem, but didn't make it into the Goal object due to an implementation error. This means that, in v201405, you cannot set the duration field when creating or updating line items. Instead, the server will set it to the default value.

Fortunately, this is only an issue for some LineItemType constants; many line item types only allow for one duration type, which is also its default, so setting it is not necessary. If you use the following line item types, v201405 will throw an error to prevent you from accidentally resetting the duration type if you update those line items:
If you need to create or update line items of these types, we recommend that you use v201403 or earlier to do so. In the next version of the API, we’ll add the duration field back as “goalType” to the Goal object. We are waiting until the next version so that we do not change the existing v201405 WSDLs, which would break early v201405 adopters' code.

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.