Posted:

Today we’re announcing the availability of three new reporting dimensions created specifically for AdMob publishers: APP_ID, APP_NAME, and APP_PLATFORM.

Here’s how they work:

  • APP_ID - This dimension matches the store ID of an application. It will be prefixed with “1:” for an App Store ID (iOS) and “2:” for a Google Play ID (Android). For example, “1:476954712” or “2:com.labpixies.lineup”.
  • APP_NAME - Matches the name of an application, like “Flood-It!” or “Line Up”.
  • APP_PLATFORM - This dimension can partition results by platform (e.g. “Android” or “iOS”).

These new dimensions are available now in the AdSense Management API. If you’re unfamiliar with it, the AdSense Management API is a web-based API that you can query to get information about your AdSense account. There are client libraries for a number of platforms, though any standard HTTP client can send requests to it and parse the responses. With a little code and these new dimensions, you can create custom reports about a single app, a family of them, or even your entire platform lineup!

For more information on building and customizing AdMob reports, check out the reporting section of the AdMob developer site. You can also use the API Explorer to test out queries that include these fields.

Posted:
We recently deprecated the default namespace in the AdSense Management API so now you should show an account picker to your users and add an account ID to all requests.

The Accounts resource offers both a name and an ID but for most accounts these were showing the same string (something like "pub-12345678901234"). To make the process more intuitive for users, we are improving the logic behind the name.

From now on, the account.name property will have the company name or, in its absence, the contact name. If you still want to show the account ID, just use the id field.

This also applies to the Host API, although the default namespace can still be used.

As always, if you have any questions, feel free to drop us a line on our API forums.

Posted:
TL;DR Projects using the AdSense Management API should now check for accounts with multiple AdSense/AdX accounts and let users pick instead of using the default namespace, as it will be disabled for some accounts.

API users with access to more than one AdSense or AdX accounts will receive an error when using the default namespace due to cases of ambiguity. We expect a very small percentage of users to have this problem, as this functionality is restricted to a limited set of accounts.

To avoid complications, make sure you're not using the default account namespace adclients.list, adunits.getAdCode, etc. and specify an account ID for every call. For that, use accounts.adclients.list, accounts.adunits.getAdCode, etc. You’ll find the whole list of calls in the API reference pages.

The flow you should always use from now on is:
  • Authenticate
  • Call accounts.list
  • Show a publisher account picker if there's more than one account
  • Do the rest of the requests using the account ID
If you have questions about this change or need help with updating your code, please let us know on the AdSense API forum or our Google+ page.

Posted:
Version 1.4 of the AdSense Management API is now available and comes with new features mainly based on suggestions and requests from developers: If you are new to the API, check out the new getting started video that covers everything you need to know to start your integration with the AdSense Management API.



Remember to visit the AdSense API forum or our Google+ page if you need any help implementing these new features!

Posted:

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!

Posted:

Version 1.3 of the AdSense Management API is now available and comes with new features to help you retrieve more publisher and reporting information.

Metadata for reporting dimensions and metrics
This is a highly requested feature that provides information on the list of available dimensions and metrics for the publishers, as well as their compatibility. This is useful to help developers avoid generating reports with invalid dimensions and metrics.

Alerts
You can now list the publisher’s current alerts, in their default language or in the one you specify.

Ad code
You can now programmatically fetch the code of an ad unit using getAdCode.

Remember to visit the AdSense API forums or our Google+ page if you need any help implementing these new features!

Posted:
You spoke and we listened; we like to do that in Developer Relations! We've heard your comments regarding Google Developer Live (GDL) events and we understand that they are often key to solving complex questions you have. In order to keep up with your demand we've scheduled another round of Hangouts for all of our products over the next few months.

In the upcoming Hangouts you'll notice that we are experimenting with some new formats. On some products you'll see engineer interviews, third party product discussions, or the typical Office Hours. You can view the newly scheduled hangouts on the Google Developers events page. Please RSVP by clicking the “I’ll be there” button if you plan on attending.

In case you haven’t joined us before, you'll need four things to join the hangout:

These hangouts are informal and conversational, which make them a great place to ask questions or give us feedback. If you have questions about our GDLs, reach out to us on the forums.

Posted:
In the AdSense Management API and AdSense Host API, you can let us manage date calculations for you. Apart from the standard YYYY-MM-DD format, all date fields accept the following special keywords:
  • today
  • startOfMonth
  • startOfYear
With these keywords you can define useful date ranges such as the following:

Start date End date
This month’s performance so far startOfMonth today
This year’s performance so far startOfYear today

But here is the really useful part: there is a handy feature that you can use to calculate relative dates by adding or subtracting days, weeks, months, or years:

Start date End date
Last 7 days’ performance today-6d today
Last month’s performance startOfMonth-1m startOfMonth-1d
Previous six months startOfMonth-6m startOfMonth-1d

You can use up to two operations per date. Let’s say we need to compare last month with the same period last year. We would need two requests like these two requests with these start and end dates:

Start date End date
Last month’s performance startOfMonth-1m startOfMonth-1d
Same month last year startOfMonth-1m-1y startOfMonth-1d-1y

If you want to try these out, we recommend using the APIs explorer. You’ll find it at the bottom of each method documentation page:
If you have any questions about this post or the AdSense APIs in general, visit the AdSense API Forum. You can also follow our Google Ads Developers G+ page for ad-related updates.


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:

Good news, everyone! Version 1.2 of the AdSense Management API is now available, and with it come two new features:
  • the ability to retrieve saved ad styles
  • the ability to retrieve and run saved reports

In addition, we’ll soon be deprecating versions 1.0 and 1.1. These will both be sunset six months from now, on April 17, 2013. Migration to the new version should be extremely simple, since version 1.2 is a superset of both previous versions, with no breaking changes.

If you have any questions or comments, let us know in the forum!


Posted:
We’re happy to announce the release of v4.1 of the AdSense Host API. Don’t let the numbering fool you, this is a major update that provides a ton of new functionality!

The new version is intended as a full replacement of AdSense Host API v3 for ContentAds hosts, with a few extra features. Changes from v4 include added support for:

With this new release, we're also announcing the sunset of version 3 of the Host API, to take place on January 1, 2013. Over the next few weeks, we will be getting in touch with existing hosts and helping them get started with the migration.

If you’re not an AdSense host yet and are interested in joining the program, take a look at our introduction page to find out more about the requirements and how it works.

Let us know if you have any questions!

Posted:

If you've recently visited any of the Google Ads Developer documentation, you may have noticed a "Feedback on this document" link at the top right corner of a page. That's right—you can now use that link to report errors, comment on existing content, or request further clarification for any of the Google Ads Developer docs:

In addition to this new channel, you can continue to reach out to us through the developer forums or Google Developers Live events.

Quang Nguyen, Ads Developer Relations Team

Posted:
Authorization is an important concern when writing software that interacts with Google’s Ads APIs. We’ve recently improved our documentation and published resources documenting how to use OAuth2 with many of our Ads APIs.

OAuth2 is an authorization flow that allows you to direct a user to a specially crafted Google URL where they grant permissions to your software to make changes to their account. With an authorized access token, you can make requests to Ads APIs on the user’s behalf. Benefits include:
  • Users don’t need to provide a username and password - they just log into Google.
  • No CAPTCHA challenges.
  • Limited scope - the user will only be prompted to grant access to a specific part of their account. For example, they could grant access to AdWords without the application being able to see their email or calendar.
OAuth2 is supported by:
The Ads API client libraries supported by Google have built-in support for OAuth2. We’ve included examples demonstrating how to use this feature in all client libraries. See your respective product and language product sites for more information on OAuth2.

We’re also hosting a Google Developers Live event covering how to use OAuth2 on August 23rd. This will be recorded if you can’t make it. If you have any questions about OAuth2, please post on the respective product API forums.

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:
Interested in more Google Ads Developers Live (Office Hours) events? We know you are because attendance has been great!

We've scheduled another round of events for AdWords, AdMob, DFP and AdSense APIs. You can view the newly scheduled live events on the Google Ads Developers Live page. Please add the events you are interested in to your calendar. You can follow our schedule by subscribing to the Google Ads Developers Office Hours calendar, which is also linked on this blog’s sidebar.

Just like in previous live events, you can join these hangouts to ask us questions or provide feedback about our products. In response to your request we will be adding AdWords API sessions for the Asia Pacific region and Japan. If you are from Asia Pacific countries or Australia and couldn’t join the hangouts before due to timezone inconvenience, we hope you will find these additional sessions more convenient. The live events in Japan will be in Japanese.

Events will rotate throughout the week to accommodate more people. We are also planning to make some of these events topic-based, where we will introduce you to a new feature of our product and then answer your questions on that topic. The dates and topics for these sessions will be announced in advance in separate blog posts.


In case you haven’t joined us before, you will need 3 things to join the hangout:
These hangouts are informal and conversational, which make them a great place to ask questions or give us feedback. If you have questions about our office hours, reach out to us on the forums.

Posted:

A few months ago Ben Birt and Nick Johnson gave us some useful insights about the development of the AdSense Management API. This week, Gregory Block shares his experience of development against the API. Greg started the Google Publisher Toolbar project and is now the Team Leader of the development behind it.

Hello Greg, thanks for agreeing to be interviewed! Can you briefly describe your project and why you started the development?

The project started as a thought experiment - what would AdSense look like if we didn’t have a web interface for people to log in to, and we could only give you information within the context of your own site? It was originally called “AdSense Minus AdSense”, in homage to Garfield Minus Garfield.

Now, it’s a central part of our publisher strategy moving forward. Our customers use our products in concert with one another, but we send them to each product to figure out what’s going on.

Think of it as an “in-context” review tool for everything you do with your site. Ultimately, it will incorporate all of our platforms - AdSense, the DoubleClick Ad Exchange, DoubleClick for Publishers, Analytics, Webmaster Tools... we want you to know about all the information available within the context of the page you’re looking at.

People look at the websites they build and manage hundreds or thousands (and for some, more) of times each working day; they use our frontends only sporadically. We push information down into the place they need it most, at the right moment, in the right context.

You have more than 18 thousand users and an average rating of 4 stars: are you happy with your project?

It’s been hugely successful internally at convincing people to look beyond product silos and really focus on the needs of our end users. Ultimately, I’m aiming to provide a better, more accessible, more immediate, and more integrated experience than they can get from our web products. We’re going to support the whole publisher ecosystem, and I’m excited about all of the things we can do in that space.

It’s also a great showcase for our APIs - most of what the chrome extension does is accessible by any user from our public APIs.

What about the development process? Do you have any suggestions for other developers?

The process begins and ends with the end user. Efforts like the Google Publisher Toolbar drove our API strategy because we had a clear need we were trying to meet. Know your user, and have a clear vision for the product and how it helps that user do what they need to do.

Behind every good app is a good idea; but a good idea isn’t good enough - execution matters. The other important thing, in my opinion, is the toolchain. We take a strict approach towards building verifiably correct JavaScript, enforce strong type safety, and we bake in unit testing at development time. The toolbar isn’t one binary - it’s lots of binaries, all interacting with each other through messaging and callbacks, and we wouldn’t be able to get here without the help and support of our tools infrastructure.

If you had to mention one thing about developing against the AdSense API that positively impressed you during the development, what would that be?

Speed, speed, speed. A thin skin on the API is an order of magnitude faster than anything you can get out of our frontends. I think the API is well within reach of most of our publishers, and we can learn a lot from what people build from it. Some of those ideas we’ll be able to feed back in.

First and foremost, use the client libraries. There’s a vast amount of stuff taken care of automatically, and you’ll write and maintain less code.

Second, get your OAuth2 flow in place early. You’re going to spend a lot of time using it, and so it’s best to get that done right away. You’ll be tempted to just hack in a key you generated by hand into the source, but user experience matters. (I’m speaking from my own failures here.)

Third, think about security. We take a very, very cautious approach about inserting content into the page, and deciding what information is allowed to live in the DOM. We could improve the user experience by loosening that restriction, but we’re looking to bulletproof the product against social engineering and information leakage. As new features propagate down through the chrome versions, we’ll be using more and more of those secure mechanisms to deliver content in-site - the Chrome Infobars API, for example, will allow us to replace our in-page notification bar with one that is less intrusive to the user and doesn’t interact with page content. Sandboxed iframes will allow us to further restrict the security container of the in-page content, and allow us to move content that previously lived in stand-alone windows into in-page overlays and provide a richer experience to publishers. We use chrome as our sole platform because it’s secure - and when it comes to surfacing sensitive information like publisher revenue, security matters.

Last, prototype early, prototype often. There’s a whole skunkworks Android application we launched solely to experiment with and theorize on. Moreover, and in many ways more importantly, I depend on a UX person to cycle through a lot of ideas with me before roughing them out in code; we then cycle back through and iterate once we’re looking at implementations until we’re happy. On more than one occasion, I’ve cut a corner and not fully implemented something that was different in the mocks, and I’ve regretted it every. single. time. Don’t underestimate the power of good design.

And if you had the magic powers to request one additional feature and have it released immediately, what would that feature be?

In the immortal words of River Song, “Spoilers”.

What else do you do at Google?

I’m also responsible for the DoubleClick Ad Exchange Seller frontend here in London, as well as running a team called Publisher Insights that recommends revenue-impacting changes to the sites of AdSense and Ad Exchange publishers through simulated A/B experimentation.

Let’s talk hobbies and personal interests. What interests do you have outside work?

I play an awful lot of video games. I play through most games exactly once, to keep the size of the Pile of Shame (the games I bought but haven’t played yet) low. I’m currently on Act 3 of Diablo 3, and having mixed emotions about the experience.

I also have a Basset Hound named Daisy, who takes up an inordinate but pleasurable amount of my time.

Soooo.....what about Mass Effect3?

Utterly devastated. Taking reasonably ‘hard sci-fi’ and giving it a magical ending is a cardinal sin; I literally wish I could un-play all three. No amount of tender, love and care is going to help me forget.

There. I’ve said it. I feel better already.

Thanks Greg! Keep up the good work!


Posted:
Interested in more Google+ Office Hour Hangouts? We know you are because attendance has been great! We've scheduled another round for all of our products this summer. You can view the newly scheduled hangouts on the Google Developers events page. Please RSVP by clicking the “I’ll be there” button if you plan on attending. You can also continue to follow our schedule by subscribing to the Google Ads Developer Office Hours calendar which is also linked on the sidebar to the right of this blog entry.

New for this round, in response to requests, we will be posting the link to the hangout in each of our respective forums. Apparently you guys are extremely interested in coming but sometimes forgetful and wanted an extra email reminder from the forums.


In case you haven’t joined us before, you will need 3 things to join the hangout:
These hangouts are informal and conversational, which make them a great place to ask questions or give us feedback. If you have questions about our office hours program, reach out to us on the forums.

Posted:

Recent visitors to any of the Ads API documentation pages will have noticed their shiny new appearance and a message to let you know the docs have moved to a new platform:

This move is much more than a skin-deep makeover. As we’ve blogged before, the new Google Developers platform is so named to reflect our focus on you, and not just on the tools we provide.

Follow the links below to take a look at the full range of Ads API docs on Google Developers:

We’ll continue to try to improve the Ads API docs on Google Developers while, over time, Google Code returns to its original purpose as an open source project hosting service. Visits to the old Google Code docs will be redirected to the corresponding Google Developers docs throughout 2012, so be sure to update your bookmarks soon.

If you have any questions about these changes please reach out to us through any of the Ads API forums or office hours.

Lesley Burr, Ads Developer Relations Team

Posted:

If you are an advanced AdSense Management API user, your application may have run into one of the several different limits we have in place. We’ve created a new documentation page to keep track of system limits, but here’s a small description of what they are and what you can do to avoid them.

API Courtesy Limit

This limit refers to the number of requests your project can make via the API in a single day, across all of your users or AdSense accounts. This is set to 10,000 queries per day for all new projects.

If you’re running into the limit, feel free to request more from the “Quotas” page for your project, in the APIs Console. We’ll look at your request and project usage history, then decide an appropriate limit to set in place.

Page size for “list” calls

The various “list” methods in the AdSense Management API are paginated, with a default size of 10,000 entries per page. You can configure this limit yourself in your request with the maxResults parameter, but you can’t set it to any value greater than 10,000.

Reports

For regular, unpaginated reports, the maximum number of rows that the API will return is 50,000. If your report is larger than that, it will be truncated at 50,000 rows.

Pagination in reports should only be used when strictly necessary, as it’s generally only useful to applications running in devices with severe storage constraints. Because of this, paginated reports are limited to 5,000 rows and any attempt to obtain data beyond the 5000th row will return an error.


Let us know in our forum if you have any questions!

Posted:
Google+ Office Hour Hangouts continue to be a hit across all of the Ads products so we're announcing that we've scheduled new events for the spring season. You can view the newly scheduled hangouts on the Google Developers events page. Please RSVP by clicking the “I’ll be there” button if you plan on attending. You can also continue to follow our schedule by subscribing to the Google Ads Developer Office Hours calendar which is also linked on the sidebar to the right of this blog entry.
In case you haven’t joined us before, you will need 3 things to join the hangout:
These hangouts are informal and conversational, which make them a great place to ask questions or give us feedback. If you have questions about our office hours program, reach out to us on the forums.