Posted:
What's changing?

We’ve updated the runtime requirements of some of our client libraries. Make sure to update your setup to keep your application compatible and secure.

Which libraries are affected?

.NET

As announced in 2014, the .NET client library requires a minimum of Microsoft .NET Framework 4.0 or Mono version 3.2.8.

Java

As announced in 2014, the Java client library now requires Java 1.6 or higher.

Perl

  • With the release of version 4.0.0 of the AdWords API Perl client library, the minimum version supported is Perl version 5.14.
  • AdWords API Perl client library version 3.5.0 supports Perl 5.8 and will continue to be supported until September with critical bug fixes only.
We updated the minimum required Perl version to 5.14 because the Perl community no longer officially supports the older versions of the language, and our client library relies on CPAN modules that no longer exist for older versions of Perl. With the installation of client library version 4.0.0, please make sure you use Perl 5.14 or newer on your system.

PHP

As announced in 2014, the PHP client library now requires PHP 5.3 or higher.

Python

Depending on whether you’re using Python 2 or 3, the Python client library has differing minimum requirements:
  • Python 2: Requires Python 2.7.9 or higher because this is the earliest version supporting SSL certificate validation.
  • Python 3: Requires Python 3.4 or higher for compatibility with the oauth2client dependency.
Ruby

The Ruby client library has dropped support for Ruby versions 1.8, 1.9, and 2.0, and we will no longer be fixing bugs specifically for those versions.

If you have any question or concerns, visit us on the forums (AdWords API, DoubleClick for Publishers API, DoubleClick Ad Exchange Buyer API), our Google+ page, or a library-specific issue tracker.

Posted:
Are you using the Google Ads API Java Client Library and Java 5 (1.5)? If so, we have important news: starting April 2015, all releases of the Google Ads API Java Client Library will only be compatible with Java 1.6 and higher.

Why this change is happening
The primary reasons for this change are: Next steps
If you are using Java 6 or higher, then you're all set -- all releases of the client library on github already support your runtime.

If you are still using Java 5 and need to migrate to Java 6 or higher, check out the following adoption guides from Oracle: Still have questions? Feel free to file an issue on the library's issues page or contact us via our Google+ page.

Posted:
As you may know, we announced the release of our new Python client library—googleads—in March, 2014. Since then, we’ve received a lot of feedback that has helped us further improve the library. Given the positive reception we’ve had with googleads, along with the improvements we’ve made to it over the past few months, the time is right for us to give our legacy Python client library—adspygoogle—a proper send-off. The legacy ads APIs Python client library has been deprecated and will be sunset on January 5th, 2015.

Between now and the sunset date, all upcoming API releases will be supported. The legacy client library will no longer be available on GitHub or PyPI after the sunset date. You can continue to use it while supported versions of the APIs are available, but it will eventually become obsolete and won’t be supported if any new issues are discovered. In order to smoothly transition to the new client library and have uninterrupted access to the newest versions of the APIs, we suggest you migrate to googleads as soon as possible. To help you migrate, we’ve prepared a migration guide.

If you discover any bugs, would like to contribute, or have feature requests for googleads, feel free to let us know via the library’s issue tracker. If you have any questions or feedback for us, you can reach us on the Google Ads Developers Google+ page.

Posted:
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.

Posted:

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.

Posted:

The Ads APIs Python client library, adspygoogle, has been around for quite some time, supporting versions of Python as old as 2.4 but capping out at 2.7. We’ve been getting more and more feedback recently that our users want Python 3 support. Also, many of adspygoogle’s dependencies are dated and no longer officially supported. We heard you, and with these items in mind...

A New Client Library

A completely new client library — googleads — is now available for Python 3 as well as Python 2.7. The new library has several advantages over our existing library:

  • Most of your code from the previous Python library will work with minimal modifications, listed below and in our migration guide.
  • The dependencies are all hosted on PyPI, so you do not need to use the --allow-external or --allow-unverified flags at install.
  • The constructors and attributes in the new library give you more control over client objects; for example, you can easily switch out OAuth 2.0 credentials and manage multiple accounts.
  • Data types are retained. Whereas adspygoogle uses strings for everything, googleads can send and receive numbers, booleans, datetimes, etc.
  • The library is more integrated with the Python standard library; for example, you can use the built-in logging framework to log SOAP messages.
  • The library is built on top of a fork of suds and allows users who are familiar with suds to take advantage of that library’s features.

Migrating to the New Client Library

Existing Python users can retain almost all of their logic working with the objects defined in our APIs. An important difference is that your responses from the API are now objects returned by suds instead of dictionaries. The objects support using dictionary syntax to retrieve values but you cannot use dictionary methods on them. Most importantly, this means that .get() and .update() are no longer supported. Where in adspygoogle you may have done this:

response = inventory_service.GetAdUnitsByStatement(statement.ToStatement())[0] ad_units = response.get('results')

You will now need to do this:

response = inventory_service.getAdUnitsByStatement(statement.ToStatement()) ad_units = response['results'] if 'results' in response else None

Some more minor changes that need to be made include changing your code to use the new methods for instantiating client and service objects and using the exact method names from our APIs, which are generally lower camel case.

For more information on migration, check out the migration guide we have posted in the new library’s wiki section.

The googleads library will be the primary focus of development moving forward. The existing adspygoogle library is now in maintenance mode but we will continue to add support for new AdWords and DFP API releases through December, 2014.

If you find any bugs, have a patch to contribute or just a feature request, please feel free to file an issue on the issue tracker.

Posted:
As part of the latest Java client library, the SelectorBuilder utility class facilitates the creation of the generic selectors that are needed to query the AdWords API. Because of the nature of the generic selectors, some boilerplate code is needed in order to instantiate the selector objects properly. Also the way that a selector is configured depends on the implementation that is being used.

With the new SelectorBuilder, you have less boilerplate code and can still chain method calls and edit selectors without needing to know all the details of the generic Selector class. Let’s take a look at some examples comparing the current way of creating selectors, and the way it is with the utility class.

NOTE: Using the SelectorBuilder class to create selectors does not restrict the user from editing the selector after it has been built.

Some examples

The SelectorBuilder class is just a builder-like object that can be chained in order to simplify the code needed to create the predicates and fields used with the API. Let’s now take a look at how the selector is created in the GetCampaigns example (available on GitHub):
    SelectorBuilder builder = new SelectorBuilder()
       .fields("Id", "Name")
       .orderAscBy("Name")
       .offset(0)
       .limit(20)
       .build();
You still need to pass all the field names as strings, but all the boilerplate code involved in setting everything on the selector is handled by the SelectorBuilder. More than that, the methods have the same signature for Axis and JAX-WS.

NOTE: To add a new field to the selection, you must call the method fields passing all fields that were used before, plus the one that you want to add:

    builder.fields("Id",
       "Name",
       // new field to the selection
       "status");
This will return the same Selector as previously, but with the field status added to the selection. (IMPORTANT: The previously created Selector DOES NOT change when making additional method calls to the builder).

All configurations available in the selector can be set using the SelectorBuilder utility. Looking at the GetKeywords example, there is sample code on how to add predicates to the selector:

    SelectorBuilder builder = new SelectorBuilder()
       .fields("Id", "AdGroupId", "MatchType",
           "KeywordText")
       .orderAscBy("AdGroupId")
       .offset(0)
       .limit(20)
       .in("AdGroupId", adGroupId.toString())
       .equals("CriteriaType", "KEYWORD")
       .build();
More examples are available in the client library repository in GitHub.

Some additional considerations

It is important to remember that the builder returns a Selector, so all its accompanying features are still present, even if you use the builder to create it.

SelectorBuilder makes available all possible predicate operators as utility methods:

    builder
       .equals(“”, value)
       .notEquals(“”, value)
       .contains(“”, value)
       .containsIgnoreCase(“”, value)
       .doesNotcontain(“”, value)
       .doesNotContainIgnoreCase(“”, value)
       .in(“”, collection)
       .notIn(“”, collection)
       .greaterThan(“”, value)
       .greaterThanEquals(“”, value)
       .lessThan(“”, value)
       .lessThanEquals(“”, value);
There are also additional ordering, paging and date range methods:

    builder
       .orderAscBy(“”)
       .orderDescBy(“”)
       .offset(offset)
       .limit(amount)
       .forDateRange(start, end);
The start and end dates are Joda-Time dates, so it is easy to add and remove days from them. The builder will parse dates according to the API format.

If you have any questions about the client libraries, you can post them on our forums. Check out our Google+ page for client library and Ads APIs updates.

Gustavo M. P. Moreira, Ads API Team

Posted:
We have moved all our client libraries to GitHub. Here’s a complete list of all our client libraries, with their new locations:



We have also moved all Wiki pages and open issues to the corresponding GitHub projects. You can find downloads for a project under its releases page. All future client library releases will be published on GitHub only, so make sure you follow us on GitHub to keep track of new releases and report issues. If you tracked the git repository on code.google.com for a client library, you should update your master branch to point to the GitHub repository instead.

If you have any questions about the client libraries, you can post them on our forums. Check out our Google+ page for client libraries and Ads APIs updates.

Posted:

We've noticed a lot of interest in having the Google Ads APIs Python Client Library made available on PyPI, so we're happy to announce that we've recently added support for it. If you use a tool such as pip, you can now install or update to the latest version of the library with all its dependencies using one simple command, for example:

pip install [--upgrade] adspygoogle

This feature was added based on community feedback, so if you have additional feature requests or a bug to report, feel free to let us know about it by creating an issue on our issue tracker or contacting us on our Google+ page.

Posted:
Help make the AdWords client libraries better by contributing to your library today! Ever wanted to see a feature implemented or fix a bug only you can recreate? Contributors share improvements, fix bugs and can even increase performance. That’s why we’ve got an easy and quick process for contributing to the client libraries.

To get involved, there’s a few simple steps. See below for an overview or scroll down for your library-specific instructions:
  1. Sign a Contributor License Agreement (CLA)
    1. For individuals
    2. For companies
  2. Create a patch
  3. Notify us of your change
  4. Check for emails from a library owner

Other things to consider are the coding standards of each library, how to create a compatible patch for the library, and the process for delivering the patch. All these items are explained in the library specific instructions below.

Instructions can be found on library-specific pages:
Following these instructions will ensure your patches are accepted in the quickest possible time.

Becoming a contributor to the AdWords API client libraries is easy and rewarding. Most of us have made changes to improve the libraries, sharing them with other users makes sense. Always ensure you sign the Contributor License Agreement before attempting to contribute. Finally, don’t forget to check out the further instructions for contributing to your library.

Posted:
As previously announced, the old Java library for AdWords and DFP APIs have now been deprecated and support for new API releases won’t be added after the end of 2013.

We’d like to remind you of some important features you will benefit from by migrating to the new Java library.

OAuth2 support
The new Java library supports OAuth2, which is the recommended authentication mechanism at Google. As we mentioned in our previous post, there are many benefits to using OAuth2 and ClientLogin will be eventually sunset.

Maven support
The new Java library is hosted on Maven, which manages jar dependencies through its pom.xml instead of managing a lot of jars manually.
<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>ads-lib</artifactId>
  <version>RELEASE</version>
</dependency>
<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>adwords-axis</artifactId>
  <version>RELEASE</version>
</dependency>
Note: See this pom.xml for AdWords or this pom.xml for DFP for a complete example.

You can check out the QuickStart guide including how you can get started with OAuth2 and Maven with the new Java library and MigrationGuide on how you can migrate from the old library.

If you find any bugs or feature requests, feel free to file an issue on our issue tracker.
As always, please feel free to ask any questions on the AdWords API forum or DFP API forum or our Google+ page.

Posted:
As previously announced, the new Java client library for the AdWords and DFP APIs is now available. As of the v201302 release of the AdWords and DFP APIs, the old Java client libraries have been deprecated.

With the deprecation:
  • Support for new API releases will be added until the end of 2013.
  • New feature requests won’t be accepted.
We strongly encourage you to migrate to the new Java library, which has better coverage of important features such as OAuth 2.0 and Maven.

You can check out the migration guide that describes procedures for migration along with best practices. Also, we’ll discuss some of the advantages you will benefit from by migrating to the new Java library in upcoming blog posts. If you’d like to discuss the migration with us, you can come to our scheduled office hours for AdWords API and DFP API.

As always, please feel free to ask any questions regarding the client libraries on our forum for AdWords API and DFP API. You can also follow the Google Ads Developer page for all Ads-related updates.

- Takeshi Hagikura, AdWords API Team

Posted:
We’ll soon be sunsetting v1.0 and v1.1 of the AdSense Management API so we encourage you to migrate to v1.2 as soon as possible. To get you started, follow this simple guide.

If you don't use the client libraries you need to replace the version on the base URL that you are using:
https://www.googleapis.com/adsense/v1.1/
with
https://www.googleapis.com/adsense/v1.2/
That will allow you to continue using the API as you were and should require no further modifications to your code.

If you use the client libraries, what you need to do depends on the language you use:
  • Java
    Download the latest client libraries and replace your project dependencies.
  • PHP
    Make sure you get the latest files from the trunk of the repository. You may only need to replace trunk/src/contrib/Google_AdSenseService.php but you should update all the files you use.
  • Python
    Good news for you! No need to download any libraries, the discovery service knows what to do. Create the service as follows:
    http = httplib2.Http()
    service = build("adsense", "v1.2", http=http)
  • C#
    Download the latest client libraries and replace your project dependencies.
To make sure you’re using the latest version, list your saved ad styles. It’s a new feature only available to v1.2, so if you don’t get an error, you’re on the right track.

To learn about the AdSense Management API read the docs and post your questions on the AdSense API Forum and we’ll do our best to help you! Also, follow our Google Ads Developers G+ page to receive important announcements and tips.

Posted:

An authorization method is a scheme the client application uses to gain access to account information. AdWords, DoubleClick Ad Exchange Buyer and DFP APIs support several authorization methods including ClientLogin, OAuth1.0a and OAuth2.0. If you are still using an email address and a password to access the API, you are using the ClientLogin method which is now deprecated and is scheduled for sunset.

In a previous blog post we’ve covered general aspects of OAuth2.0 authorization and its benefits. To describe the process in more details, we’ve created a new article that shows how to use it with our official Ruby client library.

As always, please feel free to ask any questions regarding the client libraries or the AdWords API on our forum or during scheduled office hours. You can also follow the Google Ads Developer page for all Ads-related updates.


Posted:

Today we are excited to introduce a new channel for communication - Ads Developers Google+ Page. It's a place to stay informed, engaged and connected on Ads products and developer tools.

Add our Google+ page to your circles for the latest product and feature announcements, best practices, case studies, as well as opportunities to interact with and learn from Google's Ads Developer Relations team and other members of the developer community.

We look forward to having one place to bring timely updates, concise announcements, and to share information in multimedia formats across all Ads products, as well as to listen and respond to your comments.


Posted:

The Ruby programming language is currently a popular choice for web development with Rails being the most commonly used framework. With this in mind we're releasing a new demo application that shows how to easily use the AdWords API Ruby client library with Rails.

This simple web application demonstrates the following:

  • authorization against AdWords with OAuth 1.0a and credentials re-use
  • accounts hierarchy retrieval and account selection
  • simple service request (CampaignService.get) and display results
  • basic AdHoc reporting functionality with download support

Check out the README file on installation instructions and detailed walkthrough for the demo.

Download the application from the library site or via git. It is also mirrored on GitHub (pull requests are welcome).

Posted:

The Java Client libraries for Ads APIs are some of the most popular, used by thousands of developers each day to manage their AdWords, DFA and DFP accounts. Since they were initially written years ago, we’ve gotten a lot of feedback from developers using the libraries. We’ve tried to incorporate as many suggestions as possible, but due to the legacy architecture, certain changes were not feasible.

Today we’re pleased to announce that we are officially supporting a new from-scratch rewrite of the Java Library! It is now production-ready and is no longer experimental. Read on for some reasons why you’ll want to take the new library for a spin right away.

New Features

New features in the rewritten library include:
  • Product level support for AdWords, DFA and DFP with shared common layer code.
  • Library is now hosted on Maven.
  • OAuth1.0a and OAuth2.0 support.
  • Uses the SLF4J logging facade.
  • More control over building your session, providing authentication and more.
  • Experimental AppEngine support via JAX-WS.

Migrating

The two biggest changes involve how to configure your session and how to obtain Service objects.

Here’s how you configure an AdWordsSession:
AdWordsSession session = new AdWordsSession.Builder()
    .fromFile()
    .withClientLoginToken(clientLoginToken)
    .build();
Here’s how you obtain a reference to a service:
AdWordsServices adWordsServices = new AdWordsServices();
CampaignServiceInterface campaignService =
    adWordsServices.get(session, CampaignServiceInterface.class);
Check out the migration guide we have recently published on the new project page wiki. You’ll find these procedures described in depth, along with best practices for using these classes.

The new library will be the primary focus of development moving forward. The existing AdWords and DFP java libraries are now in maintenance mode and we will continue to add support for new AdWords and DFP API releases for the near future.

If you find any bugs, have a patch to contribute or just a feature request, please feel free to file an issue on our issue tracker.

Posted:
Are you getting started with the AdWords API but short on time to read the documentation? Do you need a reference implementation of a particular API operation? Check out our client libraries code examples which have undergone extensive renovations in the last libraries release!

The code examples are one of the best resources to learn the API and understand version changes. It is also helpful to have a working code to troubleshoot issues you may have with your own implementation. You can find the list of the client libraries and the resources for each library on the AdWords API site.

There were a number of changes introduced which we hope will make the examples code base more useful and easy to follow:
  • The code examples are now oriented around typical use cases rather than the API-specific operations. To get Criteria report look for the getCriteriaReport example, to create text ads - for the createTextAds example.
  • The number of input parameters was reduced which means you can run more examples as-is now, without adding specific object IDs.
  • For each example the code is wrapped into a function which can be called with parameters. This makes it easier to find out what parameters are required and improves examples testability.
  • Some of our Best Practices are now also demonstrated in the examples and described in the comments.
We’ve also changed the example files layout. We’ve noticed developers find it easier to navigate defined sections:
  • BasicOperations: start here if you are new to the AdWords API. This directory contains examples of basic operations such as creation, updating and deletion of most commonly used objects. The examples demonstrate the principles used in the rest of the API: selectors, predicates, paging, grouping of operations.
  • Targeting, CampaignManagement: these sections contain more advanced examples on the AdWords API such as geo targeting, location extensions, experiments and ad parameters.
  • ErrorHandling: examples in the ErrorHandling directory demonstrate how to handle different kind of errors occurring during the API calls. The errors covered here are API-specific (e.g. not network errors) and not transient so they could not be solved by retrying the exact same request.
  • Reporting: this section includes examples on how to retrieve a report with the client libraries. You can find the list of reports and their fields available on our codesite page.
  • AccountManagement: examples in the AccountManagement section will be helpful if you manage more than one account via the API. Here you can find code which retrieves accounts’ hierarchy or finds units spent on particular account.
  • Optimization: If you are looking for keyword or placement ideas or traffic estimations, you can find the examples in this section.
  • Remarketing: conversion tracker and audience operations are shown in examples in the Remarketing section.
  • Misc: this section contains examples that don’t fit into any other category and also some library-specific code samples. Check out our OAuth authorization code example here.
Browse updated examples code in: DotNet, Python, Ruby, Perl, PHP. We are working to update examples for Java and JavaScript as well.

As always, please feel free to ask any questions regarding the AdWords API on our forum or during scheduled office hours.

Posted:
We’re constantly making improvements to our AdWords, DoubleClick for Advertisers (DFA) and DoubleClick for Publishers (DFP) client libraries across all supported languages. Recently, we added the following features. Read the ChangeLogs and READMEs for details on these changes:
  • GZIP compression used when sending and receiving API calls and reports. (Perl and Java do not have this for AdWords API Report Downloads).
  • SSL certificate verification.
  • AdWords only - Examples and support for the new CreateAccountService.
Please see below for a summary of other changes for each library.

DotNet
  • No other updates.

Java
  • A preview version of the rewritten Java client library is now available for AdWords, DFA and DFP APIs. Please consider this alpha-quality code; please file any bugs or feature requests on the issue tracker. The new library currently supports Maven2, SLF4J, OAuth and we have plans to support other environments and platforms.


Ruby
  • Improved parameters validation and error reporting on missing / mistyped fields.
  • HTTP headers are now logged on DEBUG level.

Perl
  • Fixes to OAuth logic to better handle misconfigurations.
  • Several bug fixes.

PHP
  • AdWords only - Added example to get the clientCustomerId for a clientEmail.
  • AdWords only - Fixed issue with GetAccountHeirarchy example when used in the sandbox.
  • Fixed issue with lingering "id" attribute after reference replacement. Added tests for SoapXmlFixer.

Python
  • Validation and error handling has been improved to make it easier to use OAuth and Google AppEngine.


You can download updated versions of our client libraries from their respective sites, or see a list of all client libraries: AdWords, DFA and DFP.

If you have any questions or would like to discuss these changes, please post on our forums: AdWords, DFA, DFP.