AdWords API
Feedback on this document

Reporting Basics

Reporting of performance data is an integral part of most AdWords API applications.

You can obtain a report with the performance data for an entire campaign. Or you can focus more narrowly, for example on the search queries which triggered your ad. See the documentation about report types to learn what options are available.

To obtain a report, your application uses AdHoc Reports to tell the API who you are, what type of report you want, your choice of download format, the name you want to give the report, and a few other things. All of this goes into the Report Definition, which your application sends to Google to initiate the download of a report.

Some statistics that go into your reports may be calculated continuously, while others may be calculated once a day. This is one aspect of how data freshness works in AdWords. To use reporting effectively, read the data freshness documentation.

If you developed an application using the now-deprecated ReportsDefinitionService, we encourage you to update your application to use AdHoc Reports. In the meantime, you can refer to archived documentation for ReportsDefinitionService.

AdHoc Reports

This method allows you to make plain synchronous HTTP requests directly to the AdWords server, an approach whose low overhead makes it suitable for high-volume reporting, especially when implemented using multiple threads (we recommend starting with 10). The HTTP request is synchronous because the call effectively blocks until the report data is ready to download.

Using AdHoc Reports, you'll probably reach the Queries Per Second (QPS) limit (RateExceededError) before you exceed the number of open connections allowed on the server.

HTTP Request

The request consists of an HTTP POST to the AdWords server at the following URL:

https://adwords.google.com/api/adwords/reportdownload/v201306

Use the normal HTTP Header values as when downloading reports:

HTTP Header Description
Authorization: GoogleLogin auth=AUTH_TOKEN Authorization to download the report. Use the same authToken that's used for the SOAP request header.
developerToken: DEVELOPER_TOKEN Your developer token consisting of a unique string, for example, 1a2B3c4D5e_-6v7w8x9y0z.
clientCustomerId: CLIENT_CUSTOMER_ID Customer ID of the client account.
returnMoneyInMicros: true | false (Optional) Set to true to receive monetary values in micros; otherwise, whole dollar currency format is used.

The POST request body should contain a parameter named "__rdxml" whose value is an XML fragment that defines the report, for example:


<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201306">
  <selector>
    <fields>CampaignId</fields>
    <fields>Id</fields>
    <fields>Impressions</fields>
    <fields>Clicks</fields>
    <fields>Cost</fields>
    <predicates>
      <field>Status</field>
      <operator>IN</operator>
      <values>ENABLED</values>
      <values>PAUSED</values>
    </predicates>
  </selector>
  <reportName>Custom Adgroup Performance Report</reportName>
  <reportType>ADGROUP_PERFORMANCE_REPORT</reportType>
  <dateRangeType>LAST_7_DAYS</dateRangeType>
  <downloadFormat>CSV</downloadFormat>
</reportDefinition>

An XML Schema (XSD) defining the structure of the reportDefinition is published at the following URL:

https://adwords.google.com/api/adwords/reportdownload/v201306/reportDefinition.xsd

Both application/x-www-form-urlencoded and multipart/form-data Content-Types are supported; for the former, you would need to URL-encode the submitted XML.

The report download request will time out after ten minutes of idle time (no data transmitted) or one hour total elapsed time. There is no explicit data size limit; however, due to a variety of factors, the server may return an error if the report is too large.

We have provided some sample Java code that makes use of AdHoc reporting for multiple clients.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.