Update: we have recently migrated code projects to GitHub and the links in the table below now point to new locations.


If you’re not using OAuth2, this blog post is aimed at you. OAuth2 is the preferred authorization mechanism at Google. That’s mainly because it’s simpler and easier to use than OAuth1 but also because it’s a lot safer than Client Login. In addition, if you’re still using Client Login you should be aware it’s deprecated.

The following video shows what you need to get started with OAuth2 for Ads. It explains what OAuth2 is, how it works, how to use it with our APIs, the different flows of OAuth2 and some best practices. If you just need the client library resources to get started, skip ahead to the Client Libraries section to get all the resources you’ll need to make the switch.



After watching the video you will understand:
  • OAuth2:
    • The Authorization mechanism
  • Better than Client Login:
    • OAuth2 is more secure
    • More specific access control
    • No CAPTCHA challenges
  • Using OAuth2:
    • Registering your application
    • Making the authentication requests
    • Where OAuth2 tokens fit into regular service calls
  • Implementing OAuth2:
  • Authorization Flows:
  • Best Practices:
    • Storing refresh_tokens
With that knowledge, updating your applications to use OAuth2 should be trivial. All the client libraries have comprehensive support for OAuth2 and helpful examples to demonstrate its use. For further information on configuring OAuth2 in any of the libraries, see the table below.

Client Library OAuth2 Resources


Library AdWords / DoubleClick Ad Exchange DoubleClick For Advertisers DoubleClick For Publishers
Java Wiki Page Code Example Wiki Page Code Example Wiki Page Code Example
Python Wiki Page
Code Example
Wiki Page Code Example Wiki Page Code Example
Ruby Wiki Page Code Example
Wiki Page Code Example
Perl Wiki Page Code Example

.Net Wiki Page Code Example Wiki Page Code Example Wiki Page Code Example
PHP Wiki Page Code Example
Wiki Page Code Example


 - , AdWords API Team

As part of our effort to provide advertisers with increasingly rich ways to tailor ads to specific geographies, we're adding new geographical targeting options and introducing a few changes to target types in Vietnam and Italy. These changes will take place July 31 - Aug 2, 2013.

Vietnam
  • All 32 existing “regions” in Vietnam will be reclassified as “provinces” to correctly reflect their administrative division
  • 30 additional provinces will be made available
Italy
  • All 103 existing "regions" in Italy will be reclassified as "provinces" to correctly reflect their administrative division
  • 7 additional provinces will be made available
  • The 20 official regions of Italy will be added and classified as “regions”
In reporting, the 103 “regions” in Italy that are being reclassified will continue to appear as “regions” for dates prior to this transition. For dates after the transition, reports will attribute performance according to the new classifications. Reports that span date ranges both before and after this change will show both regions and provinces in the “Region” column.

Tools that specifically rely on geographical target type will need to be updated to use the new classifications listed above. We recommend making these adjustments by July 31.

You can download the full list of changes mentioned above and find more information about geographical targeting on the Google Developers site.

- AdWords API Team

Today we’re releasing version 6.5.0 of the Google AdMob SDK for iOS developers. This version of the SDK includes a variety of changes including:

  • Allows you to specify if you would like your app to be treated as child-directed by calling the tagForChildDirectedTreatment: method in GADRequest or by setting the value of tag_for_child_directed_treatment to 1 in extras for older versions of the SDK. More details on this API are available here.
  • Passes Apple's advertising identifier (IDFA) to Google Ad Exchange buyers. This enables buyers to more effectively measure their marketing campaigns on Ad Exchange iOS inventory.
  • We’ve updated the warning messages that are displayed when using mediation with incorrect linker flags. The SDK now requires only the -ObjC linker flag.
  • A number of other bug fixes and maintenance updates.

Today we’re releasing version 6.5.0 of the Google AdMob SDK for iOS developers. This version of the SDK includes a variety of changes including:

  • Allows you to specify if you would like your app to be treated as child-directed by calling the tagForChildDirectedTreatment: method in GADRequest or by setting the value of tag_for_child_directed_treatment to 1 in extras for older versions of the SDK. More details on this API are available here.
  • Passes Apple's advertising identifier (IDFA) to Google Ad Exchange buyers. This enables buyers to more effectively measure their marketing campaigns on Ad Exchange iOS inventory.
  • We’ve updated the warning messages that are displayed when using mediation with incorrect linker flags. The SDK now requires only the -ObjC linker flag.
  • A number of other bug fixes and maintenance updates.

Check out the release notes for a full list of updates. You can download the latest SDK from our downloads page. If you’ve got any questions or concerns about the new SDK, please post to our forum or check out our G+ page.

If you often need to retrieve a list of recently changed objects, the CustomerSyncService can help you save many API requests. We’ve made several improvements to this service in AdWords API v201306. These include integration with feed services and exposing ad group bid modifier change information.

Feed Services, first available in v201302, allow you to manage reusable ad extensions in a modular way. The latest changes to the CustomerSyncService enable you to retrieve changes to Feeds using a CustomerSyncSelector. Specifically, you can now retrieve feed update details based on a list of FeedIds you specify.

The other main improvement to the CustomerSyncService is the inclusion of CampaignCriteria which contains ad group-level bid modifiers.

For more information on the AdWords API, subscribe to the Google Ads Developers page and if you have any questions, post them on the AdWords API forum.

Since February 2013 advertisers have been able to explicitly set the Content Bid Dimension in the API. In the meantime, we’ve also been automatically setting the Content Bid Dimension for advertisers using older versions of the API, and for those using v201302 that did not explicitly specify a bid dimension. The automatic setting followed the logic described in this blog post.

Once v201209 is deprecated and all legacy campaigns are auto-migrated to Enhanced Campaigns and Powerful Bidding (July 22, 2013), we’ll stop setting the Content Bid Dimension implicitly for ad groups (new and existing). As announced back in March, advertisers wanting to override the ad group default bid with criteria-level bids from a given content dimension will need to explicitly set the contentBidCriterionTypeGroup to the desired CriterionTypeGroup.

Existing ad groups will keep their Content Bid Dimension setting, regardless of whether it has been set implicitly or explicitly. No changes are needed if you want to preserve the same Content Bid Dimension. After July 22, if you create a new ad group or want to change the bid dimension of an existing one, you’ll have to explicitly set the Content Bid Dimension.

You can verify the content bid dimension using AdGroupService.AdGroup#contentBidCriterionTypeGroup

If you have any questions or need help with migration, please contact us on the forum. You can also reach out to us on Google+ page.

There is only one week left to migrate to the v201306 release, as v201209 will sunset on Monday 22nd July. With the sunset deadline only a few weeks away, if you haven’t already migrated to v201302 or v201306, it is recommended that you do so as soon as possible. We recommend you read our earlier post with detailed instructions for this migration.

 - , AdWords API Team

We’re pleased to announce the newest DFA Reporting API release, version 1.3. This version adds an often requested feature: the ability to retrieve the dimensions and metrics that are available for selection.

We’re pleased to announce the newest DFA Reporting API release, version 1.3. This version adds an often requested feature: the ability to retrieve the dimensions and metrics that are available for selection.

Compatible Fields

DoubleClick for Advertisers allows you to restrict the visibility of certain metrics and dimensions for individual users based on the permissions granted to the user role and filters applied to the user profile. Additionally, certain dimensions and/or metrics cannot be used in combination with one another. For these reasons it can be difficult to determine which metrics and dimensions are available. The new reports.compatibleFields resource allows you to programmatically tackle this problem, returning a listing of fields available to the current user based on the report being created.

Additional details are available in our developer documentation release notes. We’re always available to answer your questions on our forum, or you can reach out to us on our Google+ Page.


We have recently published several new resources to help developers build reporting calls to the API:

1. Metrics and dimensions reference pages, with each defined by the relevant values, formats and limits.
2. New metadata calls in the AdSense Management API V1.3 that allow developers to fetch the list of available dimensions and metrics, check compatibility between each other and find out what products are supported. A sample response might be:
{
  "kind": "adsense#reportingMetadataEntry",
  "id": "EXAMPLE_DIMENSION",
  "compatibleDimensions": [
    "1",
    "2",
    "4",
    ...
  ],
  "compatibleMetrics": [
    "AD_REQUESTS",
    "AD_REQUESTS_COVERAGE",
    "AD_REQUESTS_CTR",
    ...
  ],
  "supportedProducts": [
    "AFMC",
    "AFC",
    "AFV"
  ]
},
The compatibleDimensions field shows a list where each item is an integer representing a group of compatible dimensions. As there is no one-to-one relation between compatible dimensions, they are represented as groups (as shown below).

Examples
Group #1 Group #2 Group #3 Group #4
AD_CLIENT_ID
AD_FORMAT_CODE
AD_FORMAT_NAME





BID_TYPE_CODE
BID_TYPE_NAME







DATE
DOMAIN_NAME
MONTH
PLATFORM_TYPE_CODE
PLATFORM_TYPE_NAME
PRODUCT_CODE
PRODUCT_NAME
TARGETING_TYPE_CODE
TARGETING_TYPE_NAME
WEEK
AD_CLIENT_ID
AD_FORMAT_CODE
AD_FORMAT_NAME





BID_TYPE_CODE
BID_TYPE_NAME





BUYER_NETWORK_ID
BUYER_NETWORK_NAME
DATE

MONTH
PLATFORM_TYPE_CODE
PLATFORM_TYPE_NAME
PRODUCT_CODE
PRODUCT_NAME
TARGETING_TYPE_CODE
TARGETING_TYPE_NAME
WEEK
AD_CLIENT_ID
AD_FORMAT_CODE
AD_FORMAT_NAME
AD_UNIT_CODE
AD_UNIT_ID
AD_UNIT_NAME
AD_UNIT_SIZE_CODE
AD_UNIT_SIZE_NAME
BID_TYPE_CODE
BID_TYPE_NAME
COUNTRY_CODE
COUNTRY_NAME





DATE

MONTH
PLATFORM_TYPE_CODE
PLATFORM_TYPE_NAME
PRODUCT_CODE
PRODUCT_NAME
TARGETING_TYPE_CODE
TARGETING_TYPE_NAME
WEEK
AD_CLIENT_ID
AD_FORMAT_CODE
AD_FORMAT_NAME





BID_TYPE_CODE
BID_TYPE_NAME
COUNTRY_CODE
COUNTRY_NAME
CUSTOM_CHANNEL_CODE
CUSTOM_CHANNEL_ID
CUSTOM_CHANNEL_NAME


DATE

MONTH
PLATFORM_TYPE_CODE
PLATFORM_TYPE_NAME
PRODUCT_CODE
PRODUCT_NAME
TARGETING_TYPE_CODE
TARGETING_TYPE_NAME
WEEK

From the previous table, note that:
  • DATE, MONTH and WEEK are compatible with every group. 
  • DOMAIN_NAME (Group #1) is not compatible with CUSTOM_CHANNEL_* (Group #4). 
  • If you want to report on ad units (Group #3) you won’t be able to use custom channels since a custom channel can be applied to one or more ad units. 
  • Country names (Group #3) can be used in combination with ad units (Group #3) or custom channels (Group #4) but ad units cannot be combined with custom channels
Remember to visit the AdSense API forums or our Google+ page if you need any help generating reports!

As part of the upgrade to enhanced campaigns, we have shared updates about the AdWords API v201209 sunset. Today's note is to provide a 2 weeks reminder that v201209 sunsets on July 22nd and API requests will start failing after that date. With the sunset deadline only a few weeks away, if you haven’t already migrated to v201302 or v201306, it is recommended that you do so as soon as possible. See below for further information on migrating.

v201306 Migration

If you’re looking to migrate to v201306 from v201209, follow these steps for a successful migration:
Enhanced Campaigns Migration
If you’re migrating to Enhanced Campaigns, use the following resources to assist your migration:
 - , AdWords API Team

We are pleased to announce the release of AdWords API v201306. This latest release introduces new reports, adds platform targeting options for the Feed services, and includes improvements across other services. A complete list of changes is available in the release notes.

v201306 Highlights:
  • Three additional reports are now available to all API users. Campaign Ad Schedule Target, Campaign Platform Target and Display Keyword Performance reports.
  • Additional targeting options for Feeds. Feeds can now be targeted specifically to Mobile or Desktop platforms. Beta users can also try out AdSchedule targeting for Feeds which allows you to specify certain hours or days of the week for the extension to show on.
  • CustomerSyncService improvements related to Feed services. CustomerSyncService now returns all changes related to the Feed services.
  • MutateJobService now supports Feed and AdGroupBidModifier operations. You can now use MutateJobService to update Feeds and AdGroupBidModifiers asynchronously.

If you are still using v201209, please note that it is being sunset on July 22, 2013. We encourage you to skip v201302 and migrate straight to v201306. Follow the Ads Developers Plus Page for tips and tricks about migration. If you’re using v201302, be aware it is now marked deprecated and will be sunset on November 8th, 2013.

As with every new version of the AdWords API, we encourage you to carefully review all changes in the release notes and the v201306 migration guide. We have also published updated client libraries with code examples. If you have any questions or need help with migration, please post on the forum or Ads Developers Plus Page.

- The AdWords API Team

Unity is a game development framework that makes it very easy to develop games for mobile platforms. Today we're releasing a plugin to help developers show AdMob banner ads in Unity games developed for iOS and Android. This plugin is packaged as a Unity Package so integration with a Unity project should be very easy. The included README has a step-by-step walkthrough on getting started.

We remind developers to follow AdMob best practices when integrating ads into their games. In particular, we advise that you put ads on screens only where they won’t cause a dip in your app’s frame rate.

You can check out the AdMob Unity plugin on our samples page (Android | iOS). Please direct any questions or general feedback to our forum. You can also follow our Google+ page to stay up to date on all of Google's ads products.