blob: e392522f337aaf50fc54dc4df8a1753467e6a27b [file] [log] [blame]
<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="admob_v1.html">AdMob API</a> . <a href="admob_v1.accounts.html">accounts</a> . <a href="admob_v1.accounts.networkReport.html">networkReport</a></h1>
<h2>Instance Methods</h2>
<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(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generates an AdMob Network report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses.</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(parent, body=None, x__xgafv=None)</code>
<pre>Generates an AdMob Network report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses.
Args:
parent: string, Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 (required)
body: object, The request body.
The object takes the form of:
{ # Request to generate an AdMob Network report.
&quot;reportSpec&quot;: { # The specification for generating an AdMob Network report. For example, the specification to get clicks and estimated earnings for only the &#x27;US&#x27; and &#x27;CN&#x27; countries can look like the following example: { &#x27;date_range&#x27;: { &#x27;start_date&#x27;: {&#x27;year&#x27;: 2021, &#x27;month&#x27;: 9, &#x27;day&#x27;: 1}, &#x27;end_date&#x27;: {&#x27;year&#x27;: 2021, &#x27;month&#x27;: 9, &#x27;day&#x27;: 30} }, &#x27;dimensions&#x27;: [&#x27;DATE&#x27;, &#x27;APP&#x27;, &#x27;COUNTRY&#x27;], &#x27;metrics&#x27;: [&#x27;CLICKS&#x27;, &#x27;ESTIMATED_EARNINGS&#x27;], &#x27;dimension_filters&#x27;: [ { &#x27;dimension&#x27;: &#x27;COUNTRY&#x27;, &#x27;matches_any&#x27;: {&#x27;values&#x27;: [{&#x27;value&#x27;: &#x27;US&#x27;, &#x27;value&#x27;: &#x27;CN&#x27;}]} } ], &#x27;sort_conditions&#x27;: [ {&#x27;dimension&#x27;:&#x27;APP&#x27;, order: &#x27;ASCENDING&#x27;}, {&#x27;metric&#x27;:&#x27;CLICKS&#x27;, order: &#x27;DESCENDING&#x27;} ], &#x27;localization_settings&#x27;: { &#x27;currency_code&#x27;: &#x27;USD&#x27;, &#x27;language_code&#x27;: &#x27;en-US&#x27; } } For a better understanding, you can treat the preceding specification like the following pseudo SQL: SELECT DATE, APP, COUNTRY, CLICKS, ESTIMATED_EARNINGS FROM NETWORK_REPORT WHERE DATE &gt;= &#x27;2021-09-01&#x27; AND DATE &lt;= &#x27;2021-09-30&#x27; AND COUNTRY IN (&#x27;US&#x27;, &#x27;CN&#x27;) GROUP BY DATE, APP, COUNTRY ORDER BY APP ASC, CLICKS DESC; # Network report specification.
&quot;dateRange&quot;: { # Specification of a single date range. Both dates are inclusive. # The date range for which the report is generated.
&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 value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # End date of the date range, inclusive. Must be greater than or equal to the start date.
&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;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 value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # Start date of the date range, inclusive. Must be less than or equal to the end date.
&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;dimensionFilters&quot;: [ # Describes which report rows to match based on their dimension values.
{ # Describes which report rows to match based on their dimension values.
&quot;dimension&quot;: &quot;A String&quot;, # Applies the filter criterion to the specified dimension.
&quot;matchesAny&quot;: { # List of string values. # Matches a row if its value for the specified dimension is in one of the values specified in this condition.
&quot;values&quot;: [ # The string values.
&quot;A String&quot;,
],
},
},
],
&quot;dimensions&quot;: [ # List of dimensions of the report. The value combination of these dimensions determines the row of the report. If no dimensions are specified, the report returns a single row of requested metrics for the entire account.
&quot;A String&quot;,
],
&quot;localizationSettings&quot;: { # Localization settings for reports, such as currency and language. It affects how metrics are calculated. # Localization settings of the report.
&quot;currencyCode&quot;: &quot;A String&quot;, # Currency code of the earning related metrics, which is the 3-letter code defined in ISO 4217. The daily average rate is used for the currency conversion. Defaults to the account currency code if unspecified.
&quot;languageCode&quot;: &quot;A String&quot;, # Language used for any localized text, such as some dimension value display labels. The language tag defined in the IETF BCP47. Defaults to &#x27;en-US&#x27; if unspecified.
},
&quot;maxReportRows&quot;: 42, # Maximum number of report data rows to return. If the value is not set, the API returns as many rows as possible, up to 100000. Acceptable values are 1-100000, inclusive. Values larger than 100000 return an error.
&quot;metrics&quot;: [ # List of metrics of the report. A report must specify at least one metric.
&quot;A String&quot;,
],
&quot;sortConditions&quot;: [ # Describes the sorting of report rows. The order of the condition in the list defines its precedence; the earlier the condition, the higher its precedence. If no sort conditions are specified, the row ordering is undefined.
{ # Sorting direction to be applied on a dimension or a metric.
&quot;dimension&quot;: &quot;A String&quot;, # Sort by the specified dimension.
&quot;metric&quot;: &quot;A String&quot;, # Sort by the specified metric.
&quot;order&quot;: &quot;A String&quot;, # Sorting order of the dimension or metric.
},
],
&quot;timeZone&quot;: &quot;A String&quot;, # A report time zone. Accepts an IANA TZ name values, such as &quot;America/Los_Angeles.&quot; If no time zone is defined, the account default takes effect. Check default value by the get account action. **Warning:** The &quot;America/Los_Angeles&quot; is the only supported value at the moment.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The streaming response for the AdMob Network report where the first response contains the report header, then a stream of row responses, and finally a footer as the last response message. For example: [{ &quot;header&quot;: { &quot;dateRange&quot;: { &quot;startDate&quot;: {&quot;year&quot;: 2018, &quot;month&quot;: 9, &quot;day&quot;: 1}, &quot;endDate&quot;: {&quot;year&quot;: 2018, &quot;month&quot;: 9, &quot;day&quot;: 1} }, &quot;localizationSettings&quot;: { &quot;currencyCode&quot;: &quot;USD&quot;, &quot;languageCode&quot;: &quot;en-US&quot; } } }, { &quot;row&quot;: { &quot;dimensionValues&quot;: { &quot;DATE&quot;: {&quot;value&quot;: &quot;20180918&quot;}, &quot;APP&quot;: { &quot;value&quot;: &quot;ca-app-pub-8123415297019784~1001342552&quot;, displayLabel: &quot;My app name!&quot; } }, &quot;metricValues&quot;: { &quot;ESTIMATED_EARNINGS&quot;: {&quot;microsValue&quot;: 6500000} } } }, { &quot;footer&quot;: {&quot;matchingRowCount&quot;: 1} }]
&quot;footer&quot;: { # Groups data available after report generation, for example, warnings and row counts. Always sent as the last message in the stream response. # Additional information about the generated report, such as warnings about the data.
&quot;matchingRowCount&quot;: &quot;A String&quot;, # Total number of rows that matched the request. Warning: This count does NOT always match the number of rows in the response. Do not make that assumption when processing the response.
&quot;warnings&quot;: [ # Warnings associated with generation of the report.
{ # Warnings associated with generation of the report.
&quot;description&quot;: &quot;A String&quot;, # Describes the details of the warning message, in English.
&quot;type&quot;: &quot;A String&quot;, # Type of the warning.
},
],
},
&quot;header&quot;: { # Groups data helps to treat the generated report. Always sent as a first message in the stream response. # Report generation settings that describes the report contents, such as the report date range and localization settings.
&quot;dateRange&quot;: { # Specification of a single date range. Both dates are inclusive. # The date range for which the report is generated. This is identical to the range specified in the report request.
&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 value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # End date of the date range, inclusive. Must be greater than or equal to the start date.
&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;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 value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. # Start date of the date range, inclusive. Must be less than or equal to the end date.
&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;localizationSettings&quot;: { # Localization settings for reports, such as currency and language. It affects how metrics are calculated. # Localization settings of the report. This is identical to the settings in the report request.
&quot;currencyCode&quot;: &quot;A String&quot;, # Currency code of the earning related metrics, which is the 3-letter code defined in ISO 4217. The daily average rate is used for the currency conversion. Defaults to the account currency code if unspecified.
&quot;languageCode&quot;: &quot;A String&quot;, # Language used for any localized text, such as some dimension value display labels. The language tag defined in the IETF BCP47. Defaults to &#x27;en-US&#x27; if unspecified.
},
&quot;reportingTimeZone&quot;: &quot;A String&quot;, # The report time zone. The value is a time-zone ID as specified by the CLDR project, for example, &quot;America/Los_Angeles&quot;.
},
&quot;row&quot;: { # A row of the returning report. # Actual report data.
&quot;dimensionValues&quot;: { # Map of dimension values in a row, with keys as enum name of the dimensions.
&quot;a_key&quot;: { # Representation of a dimension value.
&quot;displayLabel&quot;: &quot;A String&quot;, # The localized string representation of the value. If unspecified, the display label should be derived from the value.
&quot;value&quot;: &quot;A String&quot;, # Dimension value in the format specified in the report&#x27;s spec Dimension enum.
},
},
&quot;metricValues&quot;: { # Map of metric values in a row, with keys as enum name of the metrics. If a metric being requested has no value returned, the map will not include it.
&quot;a_key&quot;: { # Representation of a metric value.
&quot;doubleValue&quot;: 3.14, # Double precision (approximate) decimal values. Rates are from 0 to 1.
&quot;integerValue&quot;: &quot;A String&quot;, # Metric integer value.
&quot;microsValue&quot;: &quot;A String&quot;, # Amount in micros. One million is equivalent to one unit. Currency value is in the unit (USD, EUR or other) specified by the request. For example, $6.50 whould be represented as 6500000 micros.
},
},
},
}</pre>
</div>
</body></html>