File: adsense_v2.accounts.reports.html

package info (click to toggle)
python-googleapi 2.180.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 527,124 kB
  • sloc: python: 11,076; javascript: 249; sh: 114; makefile: 59
file content (439 lines) | stat: -rw-r--r-- 43,312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="adsense_v2.html">AdSense Management API</a> . <a href="adsense_v2.accounts.html">accounts</a> . <a href="adsense_v2.accounts.reports.html">reports</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="adsense_v2.accounts.reports.saved.html">saved()</a></code>
</p>
<p class="firstline">Returns the saved Resource.</p>

<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#generate">generate(account, currencyCode=None, dateRange=None, dimensions=None, endDate_day=None, endDate_month=None, endDate_year=None, filters=None, languageCode=None, limit=None, metrics=None, orderBy=None, reportingTimeZone=None, startDate_day=None, startDate_month=None, startDate_year=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generates an ad hoc report.</p>
<p class="toc_element">
  <code><a href="#generateCsv">generateCsv(account, currencyCode=None, dateRange=None, dimensions=None, endDate_day=None, endDate_month=None, endDate_year=None, filters=None, languageCode=None, limit=None, metrics=None, orderBy=None, reportingTimeZone=None, startDate_day=None, startDate_month=None, startDate_year=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generates a csv formatted ad hoc report.</p>
<p class="toc_element">
  <code><a href="#getSaved">getSaved(name, x__xgafv=None)</a></code></p>
<p class="firstline">Gets the saved report from the given resource name.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="generate">generate(account, currencyCode=None, dateRange=None, dimensions=None, endDate_day=None, endDate_month=None, endDate_year=None, filters=None, languageCode=None, limit=None, metrics=None, orderBy=None, reportingTimeZone=None, startDate_day=None, startDate_month=None, startDate_year=None, x__xgafv=None)</code>
  <pre>Generates an ad hoc report.

Args:
  account: string, Required. The account which owns the collection of reports. Format: accounts/{account} (required)
  currencyCode: string, The [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) to use when reporting on monetary metrics. Defaults to the account&#x27;s currency if not set.
  dateRange: string, Date range of the report, if unset the range will be considered CUSTOM.
    Allowed values
      REPORTING_DATE_RANGE_UNSPECIFIED - Unspecified date range.
      CUSTOM - A custom date range specified using the `start_date` and `end_date` fields. This is the default if no ReportingDateRange is provided.
      TODAY - Current day.
      YESTERDAY - Yesterday.
      MONTH_TO_DATE - From the start of the current month to the current day. e.g. if the current date is 2020-03-12 then the range will be [2020-03-01, 2020-03-12].
      YEAR_TO_DATE - From the start of the current year to the current day. e.g. if the current date is 2020-03-12 then the range will be [2020-01-01, 2020-03-12].
      LAST_7_DAYS - Last 7 days, excluding current day.
      LAST_30_DAYS - Last 30 days, excluding current day.
  dimensions: string, Dimensions to base the report on. (repeated)
    Allowed values
      DIMENSION_UNSPECIFIED - Unspecified dimension.
      DATE - Date dimension in YYYY-MM-DD format (e.g. &quot;2010-02-10&quot;).
      WEEK - Week dimension in YYYY-MM-DD format, representing the first day of each week (e.g. &quot;2010-02-08&quot;). The first day of the week is determined by the language_code specified in a report generation request (so e.g. this would be a Monday for &quot;en-GB&quot; or &quot;es&quot;, but a Sunday for &quot;en&quot; or &quot;fr-CA&quot;).
      MONTH - Month dimension in YYYY-MM format (e.g. &quot;2010-02&quot;).
      ACCOUNT_NAME - Account name. The members of this dimension match the values from Account.display_name.
      AD_CLIENT_ID - Unique ID of an ad client. The members of this dimension match the values from AdClient.reporting_dimension_id.
      HOSTED_AD_CLIENT_ID - Unique ID of a sub-account&#x27;s ad client. The members of this dimension match the values from AdClient.reporting_dimension_id (for the sub-account).
      PRODUCT_NAME - Localized product name (e.g. &quot;AdSense for Content&quot;, &quot;AdSense for Search&quot;).
      PRODUCT_CODE - Product code (e.g. &quot;AFC&quot;, &quot;AFS&quot;). The members of this dimension match the values from AdClient.product_code.
      AD_UNIT_NAME - Ad unit name (within which an ad was served). The members of this dimension match the values from AdUnit.display_name.
      AD_UNIT_ID - Unique ID of an ad unit (within which an ad was served). The members of this dimension match the values from AdUnit.reporting_dimension_id.
      AD_UNIT_SIZE_NAME - Localized size of an ad unit (e.g. &quot;728x90&quot;, &quot;Responsive&quot;).
      AD_UNIT_SIZE_CODE - The size code of an ad unit (e.g. &quot;728x90&quot;, &quot;responsive&quot;).
      CUSTOM_CHANNEL_NAME - Custom channel name. The members of this dimension match the values from CustomChannel.display_name.
      CUSTOM_CHANNEL_ID - Unique ID of a custom channel. The members of this dimension match the values from CustomChannel.reporting_dimension_id.
      HOSTED_CUSTOM_CHANNEL_ID - Not supported.
      OWNED_SITE_DOMAIN_NAME - Domain name of a verified site (e.g. &quot;example.com&quot;). The members of this dimension match the values from Site.domain.
      OWNED_SITE_ID - Unique ID of a verified site. The members of this dimension match the values from Site.reporting_dimension_id.
      PAGE_URL - URL of the page upon which the ad was served. This is a complete URL including scheme and query parameters. Note that the URL that appears in this dimension may be a canonicalized version of the one that was used in the original request, and so may not exactly match the URL that a user might have seen. Note that there are also some caveats to be aware of when using this dimension. For more information, see [Page URL breakdown](https://support.google.com/adsense/answer/11988478).
      URL_CHANNEL_NAME - Name of a URL channel. The members of this dimension match the values from UrlChannel.uri_pattern.
      URL_CHANNEL_ID - Unique ID of a URL channel. The members of this dimension match the values from UrlChannel.reporting_dimension_id.
      BUYER_NETWORK_NAME - Name of an ad network that returned the winning ads for an ad request (e.g. &quot;Google AdWords&quot;). Note that unlike other &quot;NAME&quot; dimensions, the members of this dimensions are not localized.
      BUYER_NETWORK_ID - Unique (opaque) ID of an ad network that returned the winning ads for an ad request.
      BID_TYPE_NAME - Localized bid type name (e.g. &quot;CPC bids&quot;, &quot;CPM bids&quot;) for a served ad.
      BID_TYPE_CODE - Type of a bid (e.g. &quot;cpc&quot;, &quot;cpm&quot;) for a served ad.
      CREATIVE_SIZE_NAME - Localized creative size name (e.g. &quot;728x90&quot;, &quot;Dynamic&quot;) of a served ad.
      CREATIVE_SIZE_CODE - Creative size code (e.g. &quot;728x90&quot;, &quot;dynamic&quot;) of a served ad.
      DOMAIN_NAME - Localized name of a host on which an ad was served, after IDNA decoding (e.g. &quot;www.google.com&quot;, &quot;Web caches and other&quot;, &quot;bücher.example&quot;).
      DOMAIN_CODE - Name of a host on which an ad was served (e.g. &quot;www.google.com&quot;, &quot;webcaches&quot;, &quot;xn--bcher-kva.example&quot;).
      COUNTRY_NAME - Localized region name of a user viewing an ad (e.g. &quot;United States&quot;, &quot;France&quot;).
      COUNTRY_CODE - CLDR region code of a user viewing an ad (e.g. &quot;US&quot;, &quot;FR&quot;).
      PLATFORM_TYPE_NAME - Localized platform type name (e.g. &quot;High-end mobile devices&quot;, &quot;Desktop&quot;).
      PLATFORM_TYPE_CODE - Platform type code (e.g. &quot;HighEndMobile&quot;, &quot;Desktop&quot;).
      TARGETING_TYPE_NAME - Localized targeting type name (e.g. &quot;Contextual&quot;, &quot;Personalized&quot;, &quot;Run of Network&quot;).
      TARGETING_TYPE_CODE - Targeting type code (e.g. &quot;Keyword&quot;, &quot;UserInterest&quot;, &quot;RunOfNetwork&quot;).
      CONTENT_PLATFORM_NAME - Localized content platform name an ad request was made from (e.g. &quot;AMP&quot;, &quot;Web&quot;).
      CONTENT_PLATFORM_CODE - Content platform code an ad request was made from (e.g. &quot;AMP&quot;, &quot;HTML&quot;).
      AD_PLACEMENT_NAME - Localized ad placement name (e.g. &quot;Ad unit&quot;, &quot;Global settings&quot;, &quot;Manual&quot;).
      AD_PLACEMENT_CODE - Ad placement code (e.g. &quot;AD_UNIT&quot;, &quot;ca-pub-123456:78910&quot;, &quot;OTHER&quot;).
      REQUESTED_AD_TYPE_NAME - Localized requested ad type name (e.g. &quot;Display&quot;, &quot;Link unit&quot;, &quot;Other&quot;).
      REQUESTED_AD_TYPE_CODE - Requested ad type code (e.g. &quot;IMAGE&quot;, &quot;RADLINK&quot;, &quot;OTHER&quot;).
      SERVED_AD_TYPE_NAME - Localized served ad type name (e.g. &quot;Display&quot;, &quot;Link unit&quot;, &quot;Other&quot;).
      SERVED_AD_TYPE_CODE - Served ad type code (e.g. &quot;IMAGE&quot;, &quot;RADLINK&quot;, &quot;OTHER&quot;).
      AD_FORMAT_NAME - Localized ad format name indicating the way an ad is shown to the users on your site (e.g. &quot;In-page&quot;, &quot;Anchor&quot;, &quot;Vignette&quot;).
      AD_FORMAT_CODE - Ad format code indicating the way an ad is shown to the users on your site (e.g. &quot;ON_PAGE&quot;, &quot;ANCHOR&quot;, &quot;INTERSTITIAL&quot;).
      CUSTOM_SEARCH_STYLE_NAME - Custom search style name.
      CUSTOM_SEARCH_STYLE_ID - Custom search style id.
      DOMAIN_REGISTRANT - Domain registrants.
      WEBSEARCH_QUERY_STRING - Query strings for web searches.
  endDate_day: integer, 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&#x27;t significant.
  endDate_month: integer, Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  endDate_year: integer, Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  filters: string, A list of [filters](/adsense/management/reporting/filtering) to apply to the report. All provided filters must match in order for the data to be included in the report. (repeated)
  languageCode: string, The language to use for translating report output. If unspecified, this defaults to English (&quot;en&quot;). 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](https://en.wikipedia.org/wiki/IETF_language_tag).
  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 `total_matched_rows`.
  metrics: string, Required. Reporting metrics. (repeated)
    Allowed values
      METRIC_UNSPECIFIED - Unspecified metric.
      PAGE_VIEWS - Number of page views.
      AD_REQUESTS - Number of ad units that requested ads (for content ads) or search queries (for search ads). An ad request may result in zero, one, or multiple individual ad impressions depending on the size of the ad unit and whether any ads were available.
      MATCHED_AD_REQUESTS - Requests that returned at least one ad.
      TOTAL_IMPRESSIONS - Impressions. An impression is counted for each ad request where at least one ad has been downloaded to the user&#x27;s device and has begun to load. It is the number of ad units (for content ads) or search queries (for search ads) that showed ads.
      IMPRESSIONS - Impressions. An impression is counted for each ad request where at least one ad has been downloaded to the user&#x27;s device and has begun to load. It is the number of ad units (for content ads) or search queries (for search ads) that showed ads.
      INDIVIDUAL_AD_IMPRESSIONS - Ads shown. Different ad formats will display varying numbers of ads. For example, a vertical banner may consist of 2 or more ads. Also, the number of ads in an ad unit may vary depending on whether the ad unit is displaying standard text ads, expanded text ads or image ads.
      CLICKS - Number of times a user clicked on a standard content ad.
      PAGE_VIEWS_SPAM_RATIO - Fraction of page views considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      AD_REQUESTS_SPAM_RATIO - Fraction of ad requests considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      MATCHED_AD_REQUESTS_SPAM_RATIO - Fraction of ad requests that returned ads considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      IMPRESSIONS_SPAM_RATIO - Fraction of impressions considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO - Fraction of ad impressions considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      CLICKS_SPAM_RATIO - Fraction of clicks considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      AD_REQUESTS_COVERAGE - Ratio of requested ad units or queries to the number returned to the site.
      PAGE_VIEWS_CTR - Ratio of individual page views that resulted in a click.
      AD_REQUESTS_CTR - Ratio of ad requests that resulted in a click.
      MATCHED_AD_REQUESTS_CTR - Ratio of clicks to matched requests.
      IMPRESSIONS_CTR - Ratio of IMPRESSIONS that resulted in a click.
      INDIVIDUAL_AD_IMPRESSIONS_CTR - Ratio of individual ad impressions that resulted in a click.
      ACTIVE_VIEW_MEASURABILITY - Ratio of requests that were measurable for viewability.
      ACTIVE_VIEW_VIEWABILITY - Ratio of requests that were viewable.
      ACTIVE_VIEW_TIME - Mean time an ad was displayed on screen.
      ESTIMATED_EARNINGS - Estimated earnings of the publisher. Note that earnings up to yesterday are accurate, more recent earnings are estimated due to the possibility of spam, or exchange rate fluctuations.
      PAGE_VIEWS_RPM - Revenue per thousand page views. This is calculated by dividing the estimated revenue by the number of page views multiplied by 1000.
      AD_REQUESTS_RPM - Revenue per thousand ad requests. This is calculated by dividing estimated revenue by the number of ad requests multiplied by 1000.
      MATCHED_AD_REQUESTS_RPM - Revenue per thousand matched ad requests. This is calculated by dividing estimated revenue by the number of matched ad requests multiplied by 1000.
      IMPRESSIONS_RPM - Revenue per thousand ad impressions. This is calculated by dividing estimated revenue by the number of ad impressions multiplied by 1000.
      INDIVIDUAL_AD_IMPRESSIONS_RPM - Revenue per thousand individual ad impressions. This is calculated by dividing estimated revenue by the number of individual ad impressions multiplied by 1000.
      COST_PER_CLICK - Amount the publisher earns each time a user clicks on an ad. CPC is calculated by dividing the estimated revenue by the number of clicks received.
      ADS_PER_IMPRESSION - Number of ad views per impression.
      TOTAL_EARNINGS - Total earnings are the gross estimated earnings from revenue shared traffic before any parent and child account revenue share is applied.
      WEBSEARCH_RESULT_PAGES - Number of results pages. This metric can only be used when generating a report in the Google timezone, not the account timezone. Since the account timezone is the default for report generation, this metric can only be used by explicitly specifying `reportingTimeZone=GOOGLE_TIME_ZONE`.
      FUNNEL_REQUESTS - Number of requests for non-ad units (for example a related search unit). For more information, see [Funnel requests](https://support.google.com/adsense/answer/11586959).
      FUNNEL_IMPRESSIONS - Number of requests for non-ad units ads that returned content that was shown to the user. For more information, see [Funnel impressions](https://support.google.com/adsense/answer/11585767).
      FUNNEL_CLICKS - Number of times a user clicked on a non-ad unit, triggering further ad requests. For more information, see [Funnel clicks](https://support.google.com/adsense/answer/11586382).
      FUNNEL_RPM - Revenue per thousand funnel impressions. This is calculated by dividing estimated revenue by the number of funnel impressions multiplied by 1000. For more information, see [Funnel RPM](https://support.google.com/adsense/answer/11585979).
  orderBy: string, The name of a dimension or metric to sort the resulting report on, can be prefixed with &quot;+&quot; to sort ascending or &quot;-&quot; to sort descending. If no prefix is specified, the column is sorted ascending. (repeated)
  reportingTimeZone: string, 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](https://support.google.com/adsense/answer/9830725).
    Allowed values
      REPORTING_TIME_ZONE_UNSPECIFIED - Unspecified timezone.
      ACCOUNT_TIME_ZONE - Use the account timezone in the report.
      GOOGLE_TIME_ZONE - Use the Google timezone in the report (America/Los_Angeles).
  startDate_day: integer, 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&#x27;t significant.
  startDate_month: integer, Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  startDate_year: integer, Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Result of a generated report.
  &quot;averages&quot;: { # Row representation. # The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.
    &quot;cells&quot;: [ # Cells in the row.
      { # Cell representation.
        &quot;value&quot;: &quot;A String&quot;, # Value in the cell. The dimension cells contain strings, and the metric cells contain numbers.
      },
    ],
  },
  &quot;endDate&quot;: { # 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 # Required. End date of the range (inclusive).
    &quot;day&quot;: 42, # 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&#x27;t significant.
    &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  },
  &quot;headers&quot;: [ # The header information; one for each dimension in the request, followed by one for each metric in the request.
    { # The header information of the columns requested in the report.
      &quot;currencyCode&quot;: &quot;A String&quot;, # The [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) of this column. Only present if the header type is METRIC_CURRENCY.
      &quot;name&quot;: &quot;A String&quot;, # Required. Name of the header.
      &quot;type&quot;: &quot;A String&quot;, # Required. Type of the header.
    },
  ],
  &quot;rows&quot;: [ # The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request.
    { # Row representation.
      &quot;cells&quot;: [ # Cells in the row.
        { # Cell representation.
          &quot;value&quot;: &quot;A String&quot;, # Value in the cell. The dimension cells contain strings, and the metric cells contain numbers.
        },
      ],
    },
  ],
  &quot;startDate&quot;: { # 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 # Required. Start date of the range (inclusive).
    &quot;day&quot;: 42, # 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&#x27;t significant.
    &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
    &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  },
  &quot;totalMatchedRows&quot;: &quot;A String&quot;, # The total number of rows matched by the report request.
  &quot;totals&quot;: { # Row representation. # The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.
    &quot;cells&quot;: [ # Cells in the row.
      { # Cell representation.
        &quot;value&quot;: &quot;A String&quot;, # Value in the cell. The dimension cells contain strings, and the metric cells contain numbers.
      },
    ],
  },
  &quot;warnings&quot;: [ # Any warnings associated with generation of the report. These warnings are always returned in English.
    &quot;A String&quot;,
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="generateCsv">generateCsv(account, currencyCode=None, dateRange=None, dimensions=None, endDate_day=None, endDate_month=None, endDate_year=None, filters=None, languageCode=None, limit=None, metrics=None, orderBy=None, reportingTimeZone=None, startDate_day=None, startDate_month=None, startDate_year=None, x__xgafv=None)</code>
  <pre>Generates a csv formatted ad hoc report.

Args:
  account: string, Required. The account which owns the collection of reports. Format: accounts/{account} (required)
  currencyCode: string, The [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) to use when reporting on monetary metrics. Defaults to the account&#x27;s currency if not set.
  dateRange: string, Date range of the report, if unset the range will be considered CUSTOM.
    Allowed values
      REPORTING_DATE_RANGE_UNSPECIFIED - Unspecified date range.
      CUSTOM - A custom date range specified using the `start_date` and `end_date` fields. This is the default if no ReportingDateRange is provided.
      TODAY - Current day.
      YESTERDAY - Yesterday.
      MONTH_TO_DATE - From the start of the current month to the current day. e.g. if the current date is 2020-03-12 then the range will be [2020-03-01, 2020-03-12].
      YEAR_TO_DATE - From the start of the current year to the current day. e.g. if the current date is 2020-03-12 then the range will be [2020-01-01, 2020-03-12].
      LAST_7_DAYS - Last 7 days, excluding current day.
      LAST_30_DAYS - Last 30 days, excluding current day.
  dimensions: string, Dimensions to base the report on. (repeated)
    Allowed values
      DIMENSION_UNSPECIFIED - Unspecified dimension.
      DATE - Date dimension in YYYY-MM-DD format (e.g. &quot;2010-02-10&quot;).
      WEEK - Week dimension in YYYY-MM-DD format, representing the first day of each week (e.g. &quot;2010-02-08&quot;). The first day of the week is determined by the language_code specified in a report generation request (so e.g. this would be a Monday for &quot;en-GB&quot; or &quot;es&quot;, but a Sunday for &quot;en&quot; or &quot;fr-CA&quot;).
      MONTH - Month dimension in YYYY-MM format (e.g. &quot;2010-02&quot;).
      ACCOUNT_NAME - Account name. The members of this dimension match the values from Account.display_name.
      AD_CLIENT_ID - Unique ID of an ad client. The members of this dimension match the values from AdClient.reporting_dimension_id.
      HOSTED_AD_CLIENT_ID - Unique ID of a sub-account&#x27;s ad client. The members of this dimension match the values from AdClient.reporting_dimension_id (for the sub-account).
      PRODUCT_NAME - Localized product name (e.g. &quot;AdSense for Content&quot;, &quot;AdSense for Search&quot;).
      PRODUCT_CODE - Product code (e.g. &quot;AFC&quot;, &quot;AFS&quot;). The members of this dimension match the values from AdClient.product_code.
      AD_UNIT_NAME - Ad unit name (within which an ad was served). The members of this dimension match the values from AdUnit.display_name.
      AD_UNIT_ID - Unique ID of an ad unit (within which an ad was served). The members of this dimension match the values from AdUnit.reporting_dimension_id.
      AD_UNIT_SIZE_NAME - Localized size of an ad unit (e.g. &quot;728x90&quot;, &quot;Responsive&quot;).
      AD_UNIT_SIZE_CODE - The size code of an ad unit (e.g. &quot;728x90&quot;, &quot;responsive&quot;).
      CUSTOM_CHANNEL_NAME - Custom channel name. The members of this dimension match the values from CustomChannel.display_name.
      CUSTOM_CHANNEL_ID - Unique ID of a custom channel. The members of this dimension match the values from CustomChannel.reporting_dimension_id.
      HOSTED_CUSTOM_CHANNEL_ID - Not supported.
      OWNED_SITE_DOMAIN_NAME - Domain name of a verified site (e.g. &quot;example.com&quot;). The members of this dimension match the values from Site.domain.
      OWNED_SITE_ID - Unique ID of a verified site. The members of this dimension match the values from Site.reporting_dimension_id.
      PAGE_URL - URL of the page upon which the ad was served. This is a complete URL including scheme and query parameters. Note that the URL that appears in this dimension may be a canonicalized version of the one that was used in the original request, and so may not exactly match the URL that a user might have seen. Note that there are also some caveats to be aware of when using this dimension. For more information, see [Page URL breakdown](https://support.google.com/adsense/answer/11988478).
      URL_CHANNEL_NAME - Name of a URL channel. The members of this dimension match the values from UrlChannel.uri_pattern.
      URL_CHANNEL_ID - Unique ID of a URL channel. The members of this dimension match the values from UrlChannel.reporting_dimension_id.
      BUYER_NETWORK_NAME - Name of an ad network that returned the winning ads for an ad request (e.g. &quot;Google AdWords&quot;). Note that unlike other &quot;NAME&quot; dimensions, the members of this dimensions are not localized.
      BUYER_NETWORK_ID - Unique (opaque) ID of an ad network that returned the winning ads for an ad request.
      BID_TYPE_NAME - Localized bid type name (e.g. &quot;CPC bids&quot;, &quot;CPM bids&quot;) for a served ad.
      BID_TYPE_CODE - Type of a bid (e.g. &quot;cpc&quot;, &quot;cpm&quot;) for a served ad.
      CREATIVE_SIZE_NAME - Localized creative size name (e.g. &quot;728x90&quot;, &quot;Dynamic&quot;) of a served ad.
      CREATIVE_SIZE_CODE - Creative size code (e.g. &quot;728x90&quot;, &quot;dynamic&quot;) of a served ad.
      DOMAIN_NAME - Localized name of a host on which an ad was served, after IDNA decoding (e.g. &quot;www.google.com&quot;, &quot;Web caches and other&quot;, &quot;bücher.example&quot;).
      DOMAIN_CODE - Name of a host on which an ad was served (e.g. &quot;www.google.com&quot;, &quot;webcaches&quot;, &quot;xn--bcher-kva.example&quot;).
      COUNTRY_NAME - Localized region name of a user viewing an ad (e.g. &quot;United States&quot;, &quot;France&quot;).
      COUNTRY_CODE - CLDR region code of a user viewing an ad (e.g. &quot;US&quot;, &quot;FR&quot;).
      PLATFORM_TYPE_NAME - Localized platform type name (e.g. &quot;High-end mobile devices&quot;, &quot;Desktop&quot;).
      PLATFORM_TYPE_CODE - Platform type code (e.g. &quot;HighEndMobile&quot;, &quot;Desktop&quot;).
      TARGETING_TYPE_NAME - Localized targeting type name (e.g. &quot;Contextual&quot;, &quot;Personalized&quot;, &quot;Run of Network&quot;).
      TARGETING_TYPE_CODE - Targeting type code (e.g. &quot;Keyword&quot;, &quot;UserInterest&quot;, &quot;RunOfNetwork&quot;).
      CONTENT_PLATFORM_NAME - Localized content platform name an ad request was made from (e.g. &quot;AMP&quot;, &quot;Web&quot;).
      CONTENT_PLATFORM_CODE - Content platform code an ad request was made from (e.g. &quot;AMP&quot;, &quot;HTML&quot;).
      AD_PLACEMENT_NAME - Localized ad placement name (e.g. &quot;Ad unit&quot;, &quot;Global settings&quot;, &quot;Manual&quot;).
      AD_PLACEMENT_CODE - Ad placement code (e.g. &quot;AD_UNIT&quot;, &quot;ca-pub-123456:78910&quot;, &quot;OTHER&quot;).
      REQUESTED_AD_TYPE_NAME - Localized requested ad type name (e.g. &quot;Display&quot;, &quot;Link unit&quot;, &quot;Other&quot;).
      REQUESTED_AD_TYPE_CODE - Requested ad type code (e.g. &quot;IMAGE&quot;, &quot;RADLINK&quot;, &quot;OTHER&quot;).
      SERVED_AD_TYPE_NAME - Localized served ad type name (e.g. &quot;Display&quot;, &quot;Link unit&quot;, &quot;Other&quot;).
      SERVED_AD_TYPE_CODE - Served ad type code (e.g. &quot;IMAGE&quot;, &quot;RADLINK&quot;, &quot;OTHER&quot;).
      AD_FORMAT_NAME - Localized ad format name indicating the way an ad is shown to the users on your site (e.g. &quot;In-page&quot;, &quot;Anchor&quot;, &quot;Vignette&quot;).
      AD_FORMAT_CODE - Ad format code indicating the way an ad is shown to the users on your site (e.g. &quot;ON_PAGE&quot;, &quot;ANCHOR&quot;, &quot;INTERSTITIAL&quot;).
      CUSTOM_SEARCH_STYLE_NAME - Custom search style name.
      CUSTOM_SEARCH_STYLE_ID - Custom search style id.
      DOMAIN_REGISTRANT - Domain registrants.
      WEBSEARCH_QUERY_STRING - Query strings for web searches.
  endDate_day: integer, 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&#x27;t significant.
  endDate_month: integer, Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  endDate_year: integer, Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  filters: string, A list of [filters](/adsense/management/reporting/filtering) to apply to the report. All provided filters must match in order for the data to be included in the report. (repeated)
  languageCode: string, The language to use for translating report output. If unspecified, this defaults to English (&quot;en&quot;). 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](https://en.wikipedia.org/wiki/IETF_language_tag).
  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 `total_matched_rows`.
  metrics: string, Required. Reporting metrics. (repeated)
    Allowed values
      METRIC_UNSPECIFIED - Unspecified metric.
      PAGE_VIEWS - Number of page views.
      AD_REQUESTS - Number of ad units that requested ads (for content ads) or search queries (for search ads). An ad request may result in zero, one, or multiple individual ad impressions depending on the size of the ad unit and whether any ads were available.
      MATCHED_AD_REQUESTS - Requests that returned at least one ad.
      TOTAL_IMPRESSIONS - Impressions. An impression is counted for each ad request where at least one ad has been downloaded to the user&#x27;s device and has begun to load. It is the number of ad units (for content ads) or search queries (for search ads) that showed ads.
      IMPRESSIONS - Impressions. An impression is counted for each ad request where at least one ad has been downloaded to the user&#x27;s device and has begun to load. It is the number of ad units (for content ads) or search queries (for search ads) that showed ads.
      INDIVIDUAL_AD_IMPRESSIONS - Ads shown. Different ad formats will display varying numbers of ads. For example, a vertical banner may consist of 2 or more ads. Also, the number of ads in an ad unit may vary depending on whether the ad unit is displaying standard text ads, expanded text ads or image ads.
      CLICKS - Number of times a user clicked on a standard content ad.
      PAGE_VIEWS_SPAM_RATIO - Fraction of page views considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      AD_REQUESTS_SPAM_RATIO - Fraction of ad requests considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      MATCHED_AD_REQUESTS_SPAM_RATIO - Fraction of ad requests that returned ads considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      IMPRESSIONS_SPAM_RATIO - Fraction of impressions considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO - Fraction of ad impressions considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      CLICKS_SPAM_RATIO - Fraction of clicks considered to be spam. Only available to [premium accounts](https://developers.google.com/adsense/management/reference/rest/v2/accounts#Account.FIELDS.premium).
      AD_REQUESTS_COVERAGE - Ratio of requested ad units or queries to the number returned to the site.
      PAGE_VIEWS_CTR - Ratio of individual page views that resulted in a click.
      AD_REQUESTS_CTR - Ratio of ad requests that resulted in a click.
      MATCHED_AD_REQUESTS_CTR - Ratio of clicks to matched requests.
      IMPRESSIONS_CTR - Ratio of IMPRESSIONS that resulted in a click.
      INDIVIDUAL_AD_IMPRESSIONS_CTR - Ratio of individual ad impressions that resulted in a click.
      ACTIVE_VIEW_MEASURABILITY - Ratio of requests that were measurable for viewability.
      ACTIVE_VIEW_VIEWABILITY - Ratio of requests that were viewable.
      ACTIVE_VIEW_TIME - Mean time an ad was displayed on screen.
      ESTIMATED_EARNINGS - Estimated earnings of the publisher. Note that earnings up to yesterday are accurate, more recent earnings are estimated due to the possibility of spam, or exchange rate fluctuations.
      PAGE_VIEWS_RPM - Revenue per thousand page views. This is calculated by dividing the estimated revenue by the number of page views multiplied by 1000.
      AD_REQUESTS_RPM - Revenue per thousand ad requests. This is calculated by dividing estimated revenue by the number of ad requests multiplied by 1000.
      MATCHED_AD_REQUESTS_RPM - Revenue per thousand matched ad requests. This is calculated by dividing estimated revenue by the number of matched ad requests multiplied by 1000.
      IMPRESSIONS_RPM - Revenue per thousand ad impressions. This is calculated by dividing estimated revenue by the number of ad impressions multiplied by 1000.
      INDIVIDUAL_AD_IMPRESSIONS_RPM - Revenue per thousand individual ad impressions. This is calculated by dividing estimated revenue by the number of individual ad impressions multiplied by 1000.
      COST_PER_CLICK - Amount the publisher earns each time a user clicks on an ad. CPC is calculated by dividing the estimated revenue by the number of clicks received.
      ADS_PER_IMPRESSION - Number of ad views per impression.
      TOTAL_EARNINGS - Total earnings are the gross estimated earnings from revenue shared traffic before any parent and child account revenue share is applied.
      WEBSEARCH_RESULT_PAGES - Number of results pages. This metric can only be used when generating a report in the Google timezone, not the account timezone. Since the account timezone is the default for report generation, this metric can only be used by explicitly specifying `reportingTimeZone=GOOGLE_TIME_ZONE`.
      FUNNEL_REQUESTS - Number of requests for non-ad units (for example a related search unit). For more information, see [Funnel requests](https://support.google.com/adsense/answer/11586959).
      FUNNEL_IMPRESSIONS - Number of requests for non-ad units ads that returned content that was shown to the user. For more information, see [Funnel impressions](https://support.google.com/adsense/answer/11585767).
      FUNNEL_CLICKS - Number of times a user clicked on a non-ad unit, triggering further ad requests. For more information, see [Funnel clicks](https://support.google.com/adsense/answer/11586382).
      FUNNEL_RPM - Revenue per thousand funnel impressions. This is calculated by dividing estimated revenue by the number of funnel impressions multiplied by 1000. For more information, see [Funnel RPM](https://support.google.com/adsense/answer/11585979).
  orderBy: string, The name of a dimension or metric to sort the resulting report on, can be prefixed with &quot;+&quot; to sort ascending or &quot;-&quot; to sort descending. If no prefix is specified, the column is sorted ascending. (repeated)
  reportingTimeZone: string, 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](https://support.google.com/adsense/answer/9830725).
    Allowed values
      REPORTING_TIME_ZONE_UNSPECIFIED - Unspecified timezone.
      ACCOUNT_TIME_ZONE - Use the account timezone in the report.
      GOOGLE_TIME_ZONE - Use the Google timezone in the report (America/Los_Angeles).
  startDate_day: integer, 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&#x27;t significant.
  startDate_month: integer, Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  startDate_year: integer, Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can&#x27;t be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
  &quot;contentType&quot;: &quot;A String&quot;, # The HTTP Content-Type header value specifying the content type of the body.
  &quot;data&quot;: &quot;A String&quot;, # The HTTP request/response body as raw binary.
  &quot;extensions&quot;: [ # Application specific response metadata. Must be set in the first response for streaming APIs.
    {
      &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="getSaved">getSaved(name, x__xgafv=None)</code>
  <pre>Gets the saved report from the given resource name.

Args:
  name: string, Required. The name of the saved report to retrieve. Format: accounts/{account}/reports/{report} (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Representation of a saved report.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the report. Format: accounts/{account}/reports/{report}
  &quot;title&quot;: &quot;A String&quot;, # Report title as specified by publisher.
}</pre>
</div>

</body></html>