You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pre>Generates Campaign Report based on provided specifications.
92
+
93
+
Args:
94
+
parent: string, Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 (required)
95
+
body: object, The request body.
96
+
The object takes the form of:
97
+
98
+
{ # Request to generate campaign report.
99
+
"reportSpec": { # The specification for generating a Campaign report. For example, the specification to get IMPRESSIONS and CLICKS sliced by CAMPAIGN_ID can look like the following example: { "date_range": { "start_date": {"year": 2021, "month": 12, "day": 1}, "end_date": {"year": 2021, "month": 12, "day": 30} }, "dimensions": ["CAMPAIGN_ID"], "metrics": ["IMPRESSIONS", "CLICKS"], } # Campaign report specification.
100
+
"dateRange": { # Specification of a single date range. Both dates are inclusive. # The date range for which the report is generated. The max range is 30 days.
101
+
"endDate": { # 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 # End date of the date range, inclusive. Must be greater than or equal to the start date.
102
+
"day": 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't significant.
103
+
"month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
104
+
"year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
105
+
},
106
+
"startDate": { # 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 # Start date of the date range, inclusive. Must be less than or equal to the end date.
107
+
"day": 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't significant.
108
+
"month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
109
+
"year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
110
+
},
111
+
},
112
+
"dimensions": [ # 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.
113
+
"A String",
114
+
],
115
+
"languageCode": "A String", # Language used for any localized text, such as certain applicable dimension values. The language tag is defined in the IETF BCP47. Defaults to 'en-US' if unspecified or invalid.
116
+
"metrics": [ # List of metrics of the report. A report must specify at least one metric.
117
+
"A String",
118
+
],
119
+
},
120
+
}
121
+
122
+
x__xgafv: string, V1 error format.
123
+
Allowed values
124
+
1 - v1 error format
125
+
2 - v2 error format
126
+
127
+
Returns:
128
+
An object of the form:
129
+
130
+
{ # Campaign Report API response.
131
+
"rows": [ # The campaign report data from the specified publisher. At most 100000 rows will be returned from the API.
132
+
{ # A row of the returning report.
133
+
"dimensionValues": { # Map of dimension values in a row, with keys as enum name of the dimensions.
134
+
"a_key": { # Representation of a dimension value.
135
+
"displayLabel": "A String", # The localized string representation of the value. If unspecified, the display label should be derived from the value.
136
+
"value": "A String", # Dimension value in the format specified in the report's spec Dimension enum.
137
+
},
138
+
},
139
+
"metricValues": { # 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.
140
+
"a_key": { # Representation of a metric value.
141
+
"doubleValue": 3.14, # Double precision (approximate) decimal values. Rates are from 0 to 1.
"microsValue": "A String", # 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.
0 commit comments