Search + K

Command Palette

Search for a command to run...

Sign In

adsense.accounts.reports.generate

GET /v2/{+account}/reports:generate
Copy endpoint
https://adsense.googleapis.com/

Generates an ad hoc report.

Parameters

path Path Parameters

Name Type
account required

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

string

query Query Parameters

Name Type
currencyCode

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

string
dateRange

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

"REPORTING_DATE_RANGE_UNSPECIFIED" | "CUSTOM" | "TODAY" | "YESTERDAY" | "MONTH_TO_DATE" | "YEAR_TO_DATE" | "LAST_7_DAYS" | "LAST_30_DAYS"
dimensions

Dimensions to base the report on.

("DIMENSION_UNSPECIFIED" | "DATE" | "WEEK" | "MONTH" | "ACCOUNT_NAME" | "AD_CLIENT_ID" | "HOSTED_AD_CLIENT_ID" | "PRODUCT_NAME" | "PRODUCT_CODE" | "AD_UNIT_NAME" | "AD_UNIT_ID" | "AD_UNIT_SIZE_NAME" | "AD_UNIT_SIZE_CODE" | "CUSTOM_CHANNEL_NAME" | "CUSTOM_CHANNEL_ID" | "HOSTED_CUSTOM_CHANNEL_ID" | "OWNED_SITE_DOMAIN_NAME" | "OWNED_SITE_ID" | "PAGE_URL" | "URL_CHANNEL_NAME" | "URL_CHANNEL_ID" | "BUYER_NETWORK_NAME" | "BUYER_NETWORK_ID" | "BID_TYPE_NAME" | "BID_TYPE_CODE" | "CREATIVE_SIZE_NAME" | "CREATIVE_SIZE_CODE" | "DOMAIN_NAME" | "DOMAIN_CODE" | "COUNTRY_NAME" | "COUNTRY_CODE" | "PLATFORM_TYPE_NAME" | "PLATFORM_TYPE_CODE" | "TARGETING_TYPE_NAME" | "TARGETING_TYPE_CODE" | "TRAFFIC_SOURCE_NAME" | "TRAFFIC_SOURCE_CODE" | "CONTENT_PLATFORM_NAME" | "CONTENT_PLATFORM_CODE" | "AD_PLACEMENT_NAME" | "AD_PLACEMENT_CODE" | "REQUESTED_AD_TYPE_NAME" | "REQUESTED_AD_TYPE_CODE" | "SERVED_AD_TYPE_NAME" | "SERVED_AD_TYPE_CODE" | "AD_FORMAT_NAME" | "AD_FORMAT_CODE" | "CUSTOM_SEARCH_STYLE_NAME" | "CUSTOM_SEARCH_STYLE_ID" | "DOMAIN_REGISTRANT" | "WEBSEARCH_QUERY_STRING")[]
endDate.day

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

number
endDate.month

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

number
endDate.year

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

number
filters

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.

string[]
languageCode

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.

string
limit

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 total_matched_rows.

number
metrics

Required. Reporting metrics.

("METRIC_UNSPECIFIED" | "PAGE_VIEWS" | "AD_REQUESTS" | "MATCHED_AD_REQUESTS" | "TOTAL_IMPRESSIONS" | "IMPRESSIONS" | "INDIVIDUAL_AD_IMPRESSIONS" | "CLICKS" | "PAGE_VIEWS_SPAM_RATIO" | "AD_REQUESTS_SPAM_RATIO" | "MATCHED_AD_REQUESTS_SPAM_RATIO" | "IMPRESSIONS_SPAM_RATIO" | "INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO" | "CLICKS_SPAM_RATIO" | "AD_REQUESTS_COVERAGE" | "PAGE_VIEWS_CTR" | "AD_REQUESTS_CTR" | "MATCHED_AD_REQUESTS_CTR" | "IMPRESSIONS_CTR" | "INDIVIDUAL_AD_IMPRESSIONS_CTR" | "ACTIVE_VIEW_MEASURABILITY" | "ACTIVE_VIEW_VIEWABILITY" | "ACTIVE_VIEW_TIME" | "ESTIMATED_EARNINGS" | "PAGE_VIEWS_RPM" | "AD_REQUESTS_RPM" | "MATCHED_AD_REQUESTS_RPM" | "IMPRESSIONS_RPM" | "INDIVIDUAL_AD_IMPRESSIONS_RPM" | "COST_PER_CLICK" | "ADS_PER_IMPRESSION" | "TOTAL_EARNINGS" | "WEBSEARCH_RESULT_PAGES" | "FUNNEL_REQUESTS" | "FUNNEL_IMPRESSIONS" | "FUNNEL_CLICKS" | "FUNNEL_RPM")[]
orderBy

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.

string[]
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.

"REPORTING_TIME_ZONE_UNSPECIFIED" | "ACCOUNT_TIME_ZONE" | "GOOGLE_TIME_ZONE"
startDate.day

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

number
startDate.month

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

number
startDate.year

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

number
alt

Data format for response.

"json" | "media" | "proto"
key

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

string
$.xgafv

V1 error format.

"1" | "2"
oauth_token

OAuth 2.0 token for the current user.

string
callback

JSONP

string
prettyPrint

Returns response with indentations and line breaks.

boolean
upload_protocol

Upload protocol for media (e.g. "raw", "multipart").

string
quotaUser

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

string
uploadType

Legacy upload protocol for media (e.g. "media", "multipart").

string
fields

Selector specifying which fields to include in a partial response.

string
access_token

OAuth access token.

string

Responses

200 */*

Successful response

interface ReportResult {
averages?: Row

Row representation.

interface Row {
cells?: Cell[];
}
;
endDate?: Date

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp

interface Date {
day?: number;
month?: number;
year?: number;
}
;
headers?: Header

The header information of the columns requested in the report.

interface Header {
currencyCode?: string;
name?: string;
type?: "HEADER_TYPE_UNSPECIFIED" | "DIMENSION" | "METRIC_TALLY" | "METRIC_RATIO" | "METRIC_CURRENCY" | "METRIC_MILLISECONDS" | "METRIC_DECIMAL";
}
[]
;
rows?: Row

Row representation.

interface Row {
cells?: Cell[];
}
[]
;
startDate?: Date

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp

interface Date {
day?: number;
month?: number;
year?: number;
}
;
totalMatchedRows?: string;
totals?: Row

Row representation.

interface Row {
cells?: Cell[];
}
;
warnings?: string[];
}