Generate

Generate an AdSense report based on the report request sent in the query parameters

12 variables
12 variables

Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • View and manage your AdSense data
  • View your AdSense data

Input

This building block consumes 12 input parameters

  = Parameter name
  = Format

accountId STRING Required

Account upon which to report

startDate STRING Required

Start of the date range to report on in "YYYY-MM-DD" format, inclusive

endDate STRING Required

End of the date range to report on in "YYYY-MM-DD" format, inclusive

currency STRING

Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set

dimension STRING

Dimensions to base the report on

filter STRING

Filters to be run on the report

locale STRING

Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified

maxResults INTEGER

The maximum number of rows of report data to return

metric STRING

Numeric columns to include in the report

sort STRING

The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending

startIndex INTEGER

Index of the first row of report data to return

useTimezoneReporting BOOLEAN

Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used

Output

This building block provides 12 output parameters

  = Parameter name
  = Format

averages[] STRING

endDate STRING

The requested end date in yyyy-mm-dd format

headers[] OBJECT

headers[].currency STRING

The currency of this column. Only present if the header type is METRIC_CURRENCY

headers[].name STRING

The name of the header

headers[].type STRING

The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY

kind STRING

Kind this is, in this case adsense#report

rows[] OBJECT_ARRAY

startDate STRING

The requested start date in yyyy-mm-dd format

totalMatchedRows INTEGER

The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or the report row limit

totals[] STRING

warnings[] STRING