Method: accounts.reports.generate

Generates an ad hoc report.

HTTP request

GET https://adsense.googleapis.com/v2/{account=accounts/*}/reports:generate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
account

string

Required. The account which owns the collection of reports. Format: accounts/{account}

Query parameters

Parameters
dimensions[]

enum (Dimension)

Dimensions to base the report on.

metrics[]

enum (Metric)

Required. Reporting metrics.

filters[]

string

A list of filters to apply to the report. All provided filters must match in order for the data to be included in the report.

dateRange

enum (ReportingDateRange)

Date range of the report, if unset the range will be considered CUSTOM.

startDate

object (Date)

Start of the date range to report on, inclusive. Only needed when dateRange is CUSTOM or unspecified.

endDate

object (Date)

End of the date range to report on, inclusive. Only needed when dateRange is CUSTOM or unspecified.

orderBy[]

string

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

languageCode

string

The language to use for translating report output. If unspecified, this defaults to English ("en").

If the given language is not supported, report output will be returned in English.

The language is specified as an IETF BCP-47 language code.

currencyCode

string

The ISO-4217 currency code to use when reporting on monetary metrics. Defaults to the account's currency if not set.

limit

integer

The maximum number of rows of report data to return. Reports producing more rows than the requested limit will be truncated.

If unset, this defaults to 100,000 rows for Reports.GenerateReport and 1,000,000 rows for Reports.GenerateCsvReport, which are also the maximum values permitted here.

Report truncation can be identified (for Reports.GenerateReport only) by comparing the number of rows returned to the value returned in totalMatchedRows.

reportingTimeZone

enum (ReportingTimeZone)

Timezone in which to generate the report. If unspecified, this defaults to the account timezone.

For more information, see changing the time zone of your reports.

Request body

The request body must be empty.

Response body

If successful, the response body contains an instance of ReportResult.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/adsense
  • https://www.googleapis.com/auth/adsense.readonly