blob: b77f952611a7e88a80a413a4105392ea302b379a [file] [log] [blame]
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="analyticsdata_v1alpha.html">Google Analytics Data API</a> . <a href="analyticsdata_v1alpha.v1alpha.html">v1alpha</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#batchRunPivotReports">batchRunPivotReports(body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Returns multiple pivot reports in a batch. All reports must be for the same Entity.</p>
80<p class="toc_element">
81 <code><a href="#batchRunReports">batchRunReports(body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Returns multiple reports in a batch. All reports must be for the same Entity.</p>
83<p class="toc_element">
84 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</p>
86<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070087 <code><a href="#runPivotReport">runPivotReport(body=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.</p>
89<p class="toc_element">
90 <code><a href="#runReport">runReport(body=None, x__xgafv=None)</a></code></p>
91<p class="firstline">Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="batchRunPivotReports">batchRunPivotReports(body=None, x__xgafv=None)</code>
95 <pre>Returns multiple pivot reports in a batch. All reports must be for the same Entity.
96
97Args:
98 body: object, The request body.
99 The object takes the form of:
100
101{ # The batch request containing multiple pivot report requests.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800102 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. This entity must be specified for the batch. The entity within RunPivotReportRequest may either be unspecified or consistent with this entity.
103 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
104 },
105 &quot;requests&quot;: [ # Individual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests.
106 { # The request to generate a pivot report.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800107 &quot;cohortSpec&quot;: { # The specification of cohorts for a cohort report. Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the `cohort` object. Following that cohort for the next six weeks is specified in the `cohortsRange` object. For examples, see [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. # Cohort group associated with this request. If there is a cohort group in the request the &#x27;cohort&#x27; dimension must be present.
108 &quot;cohortReportSettings&quot;: { # Optional settings of a cohort report. # Optional settings for a cohort report.
109 &quot;accumulate&quot;: True or False, # If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800110 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800111 &quot;cohorts&quot;: [ # Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.
112 { # Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same `firstSessionDate` belong to the same cohort.
113 &quot;dateRange&quot;: { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges. # The cohort selects users whose first touch date is between start date and end date defined in the `dateRange`. This `dateRange` does not specify the full date range of event data that is present in a cohort report. In a cohort report, this `dateRange` is extended by the granularity and offset present in the `cohortsRange`; event data for the extended reporting date range is present in a cohort report. In a cohort request, this `dateRange` is required and the `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. This `dateRange` should generally be aligned with the cohort&#x27;s granularity. If `CohortsRange` uses daily granularity, this `dateRange` can be a single day. If `CohortsRange` uses weekly granularity, this `dateRange` can be aligned to a week boundary, starting at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to a month, starting at the first and ending on the last day of the month.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800114 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
115 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
116 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
117 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800118 &quot;dimension&quot;: &quot;A String&quot;, # Dimension used by the cohort. Required and only supports `firstSessionDate`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800119 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this cohort. The dimension `cohort` is valued to this name in a report response. If set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero based index `cohort_0`, `cohort_1`, etc.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800120 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800121 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800122 &quot;cohortsRange&quot;: { # Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over. # Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.
123 &quot;endOffset&quot;: 42, # Required. `endOffset` specifies the end date of the extended reporting date range for a cohort report. `endOffset` can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods. If `granularity` is `DAILY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset` days. If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 7` days. If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 30` days.
124 &quot;granularity&quot;: &quot;A String&quot;, # Required. The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report.
125 &quot;startOffset&quot;: 42, # `startOffset` specifies the start date of the extended reporting date range for a cohort report. `startOffset` is commonly set to 0 so that reports contain data from the acquisition of the cohort forward. If `granularity` is `DAILY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 30` days.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800126 },
127 },
128 &quot;currencyCode&quot;: &quot;A String&quot;, # A currency code in ISO4217 format, such as &quot;AED&quot;, &quot;USD&quot;, &quot;JPY&quot;. If the field is empty, the report uses the entity&#x27;s default currency.
129 &quot;dateRanges&quot;: [ # The date range to retrieve event data for the report. If multiple date ranges are specified, event data from each date range is used in the report. A special dimension with field name &quot;dateRange&quot; can be included in a Pivot&#x27;s field names; if included, the report compares between date ranges. In a cohort request, this `dateRanges` must be unspecified.
130 { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.
131 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
132 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
133 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
134 },
135 ],
136 &quot;dimensionFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
137 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
138 &quot;expressions&quot;: [ # A list of filter expressions.
139 # Object with schema name: FilterExpression
140 ],
141 },
142 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
143 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
144 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
145 &quot;doubleValue&quot;: 3.14, # Double value
146 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
147 },
148 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
149 &quot;doubleValue&quot;: 3.14, # Double value
150 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
151 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800152 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800153 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
154 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
155 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
156 &quot;values&quot;: [ # The list of string values. Must be non-empty.
157 &quot;A String&quot;,
158 ],
159 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800160 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
161 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
162 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
163 &quot;doubleValue&quot;: 3.14, # Double value
164 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
165 },
166 },
167 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
168 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
169 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
170 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
171 },
172 },
173 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
174 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
175 &quot;expressions&quot;: [ # A list of filter expressions.
176 # Object with schema name: FilterExpression
177 ],
178 },
179 },
180 &quot;dimensions&quot;: [ # The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
181 { # Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, city could be &quot;Paris&quot; or &quot;New York&quot;. Requests are allowed up to 8 dimensions.
182 &quot;dimensionExpression&quot;: { # Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2). # One dimension can be the result of an expression of multiple dimensions. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
183 &quot;concatenate&quot;: { # Used to combine dimension values to a single dimension. # Used to combine dimension values to a single dimension. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
184 &quot;delimiter&quot;: &quot;A String&quot;, # The delimiter placed between dimension names. Delimiters are often single characters such as &quot;|&quot; or &quot;,&quot; but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = &quot;US,FR&quot;, dimension 2 value = &quot;JP&quot;, and delimiter = &quot;,&quot;, then the response will contain &quot;US,FR,JP&quot;.
185 &quot;dimensionNames&quot;: [ # Names of dimensions. The names must refer back to names in the dimensions field of the request.
186 &quot;A String&quot;,
187 ],
188 },
189 &quot;lowerCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to lower case.
190 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
191 },
192 &quot;upperCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to upper case.
193 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
194 },
195 },
196 &quot;name&quot;: &quot;A String&quot;, # The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names. If `dimensionExpression` is specified, `name` can be any string that you would like. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`.
197 },
198 ],
199 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. Within a batch request, this entity should either be unspecified or consistent with the batch-level entity.
200 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
201 },
202 &quot;keepEmptyRows&quot;: True or False, # If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
203 &quot;metricFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
204 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
205 &quot;expressions&quot;: [ # A list of filter expressions.
206 # Object with schema name: FilterExpression
207 ],
208 },
209 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
210 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
211 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
212 &quot;doubleValue&quot;: 3.14, # Double value
213 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
214 },
215 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
216 &quot;doubleValue&quot;: 3.14, # Double value
217 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
218 },
219 },
220 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
221 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
222 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
223 &quot;values&quot;: [ # The list of string values. Must be non-empty.
224 &quot;A String&quot;,
225 ],
226 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800227 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
228 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
229 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
230 &quot;doubleValue&quot;: 3.14, # Double value
231 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
232 },
233 },
234 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
235 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
236 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
237 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
238 },
239 },
240 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
241 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
242 &quot;expressions&quot;: [ # A list of filter expressions.
243 # Object with schema name: FilterExpression
244 ],
245 },
246 },
247 &quot;metrics&quot;: [ # The metrics requested, at least one metric needs to be specified. All defined metrics must be used by one of the following: metric_expression, metric_filter, order_bys.
248 { # The quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.
249 &quot;expression&quot;: &quot;A String&quot;, # A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`.
250 &quot;invisible&quot;: True or False, # Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`.
251 &quot;name&quot;: &quot;A String&quot;, # The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names. If `expression` is specified, `name` can be any string that you would like. For example if `expression` is `screenPageViews/sessions`, you could call that metric&#x27;s name = `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`.
252 },
253 ],
254 &quot;pivots&quot;: [ # Describes the visual format of the report&#x27;s dimensions in columns or rows. The union of the fieldNames (dimension names) in all pivots must be a subset of dimension names defined in Dimensions. No two pivots can share a dimension. A dimension is only visible if it appears in a pivot.
255 { # Describes the visible dimension columns and rows in the report response.
256 &quot;fieldNames&quot;: [ # Dimension names for visible columns in the report response. Including &quot;dateRange&quot; produces a date range column; for each row in the response, dimension values in the date range column will indicate the corresponding date range from the request.
257 &quot;A String&quot;,
258 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800259 &quot;limit&quot;: &quot;A String&quot;, # The number of rows to return in this pivot. If the `limit` parameter is unspecified, up to 10,000 rows are returned. The product of the `limit` for each `pivot` in a `RunPivotReportRequest` must not exceed 100,000. For example, a two pivot request with `limit: 1000` in each pivot will fail because the product is `1,000,000`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800260 &quot;metricAggregations&quot;: [ # Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations.
261 &quot;A String&quot;,
262 ],
263 &quot;offset&quot;: &quot;A String&quot;, # The row count of the start row. The first row is counted as row 0.
264 &quot;orderBys&quot;: [ # Specifies how dimensions are ordered in the pivot. In the first Pivot, the OrderBys determine Row and PivotDimensionHeader ordering; in subsequent Pivots, the OrderBys determine only PivotDimensionHeader ordering. Dimensions specified in these OrderBys must be a subset of Pivot.field_names.
265 { # The sort options.
266 &quot;desc&quot;: True or False, # If true, sorts by descending order.
267 &quot;dimension&quot;: { # Sorts by dimension values. # Sorts results by a dimension&#x27;s values.
268 &quot;dimensionName&quot;: &quot;A String&quot;, # A dimension name in the request to order by.
269 &quot;orderType&quot;: &quot;A String&quot;, # Controls the rule for dimension value ordering.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800270 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800271 &quot;metric&quot;: { # Sorts by metric values. # Sorts results by a metric&#x27;s values.
272 &quot;metricName&quot;: &quot;A String&quot;, # A metric name in the request to order by.
273 },
274 &quot;pivot&quot;: { # Sorts by a pivot column group. # Sorts results by a metric&#x27;s values within a pivot column group.
275 &quot;metricName&quot;: &quot;A String&quot;, # In the response to order by, order rows by this column. Must be a metric name from the request.
276 &quot;pivotSelections&quot;: [ # Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row&#x27;s dimension name and value pair.
277 { # A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric&#x27;s value. For example if pivots = {{&quot;browser&quot;, &quot;Chrome&quot;}} and metric_name = &quot;Sessions&quot;, then the rows will be sorted based on Sessions in Chrome. ---------|----------|----------------|----------|---------------- | Chrome | Chrome | Safari | Safari ---------|----------|----------------|----------|---------------- Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions ---------|----------|----------------|----------|---------------- US | 2 | 2 | 3 | 1 ---------|----------|----------------|----------|---------------- Canada | 3 | 1 | 4 | 1 ---------|----------|----------------|----------|----------------
278 &quot;dimensionName&quot;: &quot;A String&quot;, # Must be a dimension name from the request.
279 &quot;dimensionValue&quot;: &quot;A String&quot;, # Order by only when the named dimension is this value.
280 },
281 ],
282 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800283 },
284 ],
285 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800286 ],
287 &quot;returnPropertyQuota&quot;: True or False, # Toggles whether to return the current state of this Analytics Property&#x27;s quota. Quota is returned in [PropertyQuota](#PropertyQuota).
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800288 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800289 ],
290}
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700291
292 x__xgafv: string, V1 error format.
293 Allowed values
294 1 - v1 error format
295 2 - v2 error format
296
297Returns:
298 An object of the form:
299
300 { # The batch response containing multiple pivot reports.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800301 &quot;pivotReports&quot;: [ # Individual responses. Each response has a separate pivot report request.
302 { # The response pivot report table corresponding to a pivot request.
303 &quot;aggregates&quot;: [ # Aggregation of metric values. Can be totals, minimums, or maximums. The returned aggregations are controlled by the metric_aggregations in the pivot. The type of aggregation returned in each row is shown by the dimension_values which are set to &quot;RESERVED_&quot;.
304 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
305 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
306 { # The value of a dimension.
307 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
308 },
309 ],
310 &quot;metricValues&quot;: [ # List of requested visible metric values.
311 { # The value of a metric.
312 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
313 },
314 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800315 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800316 ],
317 &quot;dimensionHeaders&quot;: [ # Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
318 { # Describes a dimension column in the report. Dimensions requested in a report produce column entries within rows and DimensionHeaders. However, dimensions used exclusively within filters or expressions do not produce columns in a report; correspondingly, those dimensions do not produce headers.
319 &quot;name&quot;: &quot;A String&quot;, # The dimension&#x27;s name.
320 },
321 ],
322 &quot;metadata&quot;: { # Response&#x27;s metadata carrying additional information about the report content. # Metadata for the report.
323 &quot;dataLossFromOtherRow&quot;: True or False, # If true, indicates some buckets of dimension combinations are rolled into &quot;(other)&quot; row. This can happen for high cardinality reports.
324 },
325 &quot;metricHeaders&quot;: [ # Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
326 { # Describes a metric column in the report. Visible metrics requested in a report produce column entries within rows and MetricHeaders. However, metrics used exclusively within filters or expressions do not produce columns in a report; correspondingly, those metrics do not produce headers.
327 &quot;name&quot;: &quot;A String&quot;, # The metric&#x27;s name.
328 &quot;type&quot;: &quot;A String&quot;, # The metric&#x27;s data type.
329 },
330 ],
331 &quot;pivotHeaders&quot;: [ # Summarizes the columns and rows created by a pivot. Each pivot in the request produces one header in the response. If we have a request like this: &quot;pivots&quot;: [{ &quot;fieldNames&quot;: [&quot;country&quot;, &quot;city&quot;] }, { &quot;fieldNames&quot;: &quot;eventName&quot; }] We will have the following `pivotHeaders` in the response: &quot;pivotHeaders&quot; : [{ &quot;dimensionHeaders&quot;: [{ &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;United Kingdom&quot; }, { &quot;value&quot;: &quot;London&quot; } ] }, { &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;Japan&quot; }, { &quot;value&quot;: &quot;Osaka&quot; } ] }] }, { &quot;dimensionHeaders&quot;: [{ &quot;dimensionValues&quot;: [{ &quot;value&quot;: &quot;session_start&quot; }] }, { &quot;dimensionValues&quot;: [{ &quot;value&quot;: &quot;scroll&quot; }] }] }]
332 { # Dimensions&#x27; values in a single pivot.
333 &quot;pivotDimensionHeaders&quot;: [ # The size is the same as the cardinality of the corresponding dimension combinations.
334 { # Summarizes dimension values from a row for this pivot.
335 &quot;dimensionValues&quot;: [ # Values of multiple dimensions in a pivot.
336 { # The value of a dimension.
337 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
338 },
339 ],
340 },
341 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800342 &quot;rowCount&quot;: 42, # The cardinality of the pivot. The total number of rows for this pivot&#x27;s fields regardless of how the parameters `offset` and `limit` are specified in the request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800343 },
344 ],
345 &quot;propertyQuota&quot;: { # Current state of all quotas for this Analytics Property. If any quota for a property is exhausted, all requests to that property will return Resource Exhausted errors. # This Analytics Property&#x27;s quota state including this request.
346 &quot;concurrentRequests&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.
347 &quot;consumed&quot;: 42, # Quota consumed by this request.
348 &quot;remaining&quot;: 42, # Quota remaining after this request.
349 },
350 &quot;serverErrorsPerProjectPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.
351 &quot;consumed&quot;: 42, # Quota consumed by this request.
352 &quot;remaining&quot;: 42, # Quota remaining after this request.
353 },
354 &quot;tokensPerDay&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 25,000 tokens per day; Analytics 360 Properties can use 250,000 tokens per day. Most requests consume fewer than 10 tokens.
355 &quot;consumed&quot;: 42, # Quota consumed by this request.
356 &quot;remaining&quot;: 42, # Quota remaining after this request.
357 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800358 &quot;tokensPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from both the hourly and daily quotas.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800359 &quot;consumed&quot;: 42, # Quota consumed by this request.
360 &quot;remaining&quot;: 42, # Quota remaining after this request.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800361 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700362 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800363 &quot;rows&quot;: [ # Rows of dimension value combinations and metric values in the report.
364 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
365 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
366 { # The value of a dimension.
367 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
368 },
369 ],
370 &quot;metricValues&quot;: [ # List of requested visible metric values.
371 { # The value of a metric.
372 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
373 },
374 ],
375 },
376 ],
377 },
378 ],
379}</pre>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700380</div>
381
382<div class="method">
383 <code class="details" id="batchRunReports">batchRunReports(body=None, x__xgafv=None)</code>
384 <pre>Returns multiple reports in a batch. All reports must be for the same Entity.
385
386Args:
387 body: object, The request body.
388 The object takes the form of:
389
390{ # The batch request containing multiple report requests.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800391 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. This entity must be specified for the batch. The entity within RunReportRequest may either be unspecified or consistent with this entity.
392 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
393 },
394 &quot;requests&quot;: [ # Individual requests. Each request has a separate report response. Each batch request is allowed up to 5 requests.
395 { # The request to generate a report.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800396 &quot;cohortSpec&quot;: { # The specification of cohorts for a cohort report. Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the `cohort` object. Following that cohort for the next six weeks is specified in the `cohortsRange` object. For examples, see [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. # Cohort group associated with this request. If there is a cohort group in the request the &#x27;cohort&#x27; dimension must be present.
397 &quot;cohortReportSettings&quot;: { # Optional settings of a cohort report. # Optional settings for a cohort report.
398 &quot;accumulate&quot;: True or False, # If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800399 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800400 &quot;cohorts&quot;: [ # Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.
401 { # Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same `firstSessionDate` belong to the same cohort.
402 &quot;dateRange&quot;: { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges. # The cohort selects users whose first touch date is between start date and end date defined in the `dateRange`. This `dateRange` does not specify the full date range of event data that is present in a cohort report. In a cohort report, this `dateRange` is extended by the granularity and offset present in the `cohortsRange`; event data for the extended reporting date range is present in a cohort report. In a cohort request, this `dateRange` is required and the `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. This `dateRange` should generally be aligned with the cohort&#x27;s granularity. If `CohortsRange` uses daily granularity, this `dateRange` can be a single day. If `CohortsRange` uses weekly granularity, this `dateRange` can be aligned to a week boundary, starting at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to a month, starting at the first and ending on the last day of the month.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800403 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
404 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
405 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800406 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800407 &quot;dimension&quot;: &quot;A String&quot;, # Dimension used by the cohort. Required and only supports `firstSessionDate`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800408 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this cohort. The dimension `cohort` is valued to this name in a report response. If set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero based index `cohort_0`, `cohort_1`, etc.
409 },
410 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800411 &quot;cohortsRange&quot;: { # Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over. # Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.
412 &quot;endOffset&quot;: 42, # Required. `endOffset` specifies the end date of the extended reporting date range for a cohort report. `endOffset` can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods. If `granularity` is `DAILY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset` days. If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 7` days. If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 30` days.
413 &quot;granularity&quot;: &quot;A String&quot;, # Required. The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report.
414 &quot;startOffset&quot;: 42, # `startOffset` specifies the start date of the extended reporting date range for a cohort report. `startOffset` is commonly set to 0 so that reports contain data from the acquisition of the cohort forward. If `granularity` is `DAILY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 30` days.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800415 },
416 },
417 &quot;currencyCode&quot;: &quot;A String&quot;, # A currency code in ISO4217 format, such as &quot;AED&quot;, &quot;USD&quot;, &quot;JPY&quot;. If the field is empty, the report uses the entity&#x27;s default currency.
418 &quot;dateRanges&quot;: [ # Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this `dateRanges` must be unspecified.
419 { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.
420 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
421 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
422 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
423 },
424 ],
425 &quot;dimensionFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
426 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
427 &quot;expressions&quot;: [ # A list of filter expressions.
428 # Object with schema name: FilterExpression
429 ],
430 },
431 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
432 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
433 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
434 &quot;doubleValue&quot;: 3.14, # Double value
435 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800436 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800437 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
438 &quot;doubleValue&quot;: 3.14, # Double value
439 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
440 },
441 },
442 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
443 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
444 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
445 &quot;values&quot;: [ # The list of string values. Must be non-empty.
446 &quot;A String&quot;,
447 ],
448 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800449 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
450 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
451 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
452 &quot;doubleValue&quot;: 3.14, # Double value
453 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
454 },
455 },
456 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
457 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
458 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
459 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
460 },
461 },
462 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
463 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
464 &quot;expressions&quot;: [ # A list of filter expressions.
465 # Object with schema name: FilterExpression
466 ],
467 },
468 },
469 &quot;dimensions&quot;: [ # The dimensions requested and displayed.
470 { # Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, city could be &quot;Paris&quot; or &quot;New York&quot;. Requests are allowed up to 8 dimensions.
471 &quot;dimensionExpression&quot;: { # Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2). # One dimension can be the result of an expression of multiple dimensions. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
472 &quot;concatenate&quot;: { # Used to combine dimension values to a single dimension. # Used to combine dimension values to a single dimension. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
473 &quot;delimiter&quot;: &quot;A String&quot;, # The delimiter placed between dimension names. Delimiters are often single characters such as &quot;|&quot; or &quot;,&quot; but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = &quot;US,FR&quot;, dimension 2 value = &quot;JP&quot;, and delimiter = &quot;,&quot;, then the response will contain &quot;US,FR,JP&quot;.
474 &quot;dimensionNames&quot;: [ # Names of dimensions. The names must refer back to names in the dimensions field of the request.
475 &quot;A String&quot;,
476 ],
477 },
478 &quot;lowerCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to lower case.
479 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
480 },
481 &quot;upperCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to upper case.
482 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
483 },
484 },
485 &quot;name&quot;: &quot;A String&quot;, # The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names. If `dimensionExpression` is specified, `name` can be any string that you would like. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`.
486 },
487 ],
488 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. Within a batch request, this entity should either be unspecified or consistent with the batch-level entity.
489 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
490 },
491 &quot;keepEmptyRows&quot;: True or False, # If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800492 &quot;limit&quot;: &quot;A String&quot;, # The number of rows to return. If the `limit` parameter is unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800493 &quot;metricAggregations&quot;: [ # Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to &quot;RESERVED_(MetricAggregation)&quot;.
494 &quot;A String&quot;,
495 ],
496 &quot;metricFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
497 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
498 &quot;expressions&quot;: [ # A list of filter expressions.
499 # Object with schema name: FilterExpression
500 ],
501 },
502 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
503 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
504 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
505 &quot;doubleValue&quot;: 3.14, # Double value
506 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
507 },
508 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
509 &quot;doubleValue&quot;: 3.14, # Double value
510 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
511 },
512 },
513 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
514 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
515 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
516 &quot;values&quot;: [ # The list of string values. Must be non-empty.
517 &quot;A String&quot;,
518 ],
519 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800520 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
521 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
522 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
523 &quot;doubleValue&quot;: 3.14, # Double value
524 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
525 },
526 },
527 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
528 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
529 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
530 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
531 },
532 },
533 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
534 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
535 &quot;expressions&quot;: [ # A list of filter expressions.
536 # Object with schema name: FilterExpression
537 ],
538 },
539 },
540 &quot;metrics&quot;: [ # The metrics requested and displayed.
541 { # The quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.
542 &quot;expression&quot;: &quot;A String&quot;, # A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`.
543 &quot;invisible&quot;: True or False, # Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`.
544 &quot;name&quot;: &quot;A String&quot;, # The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names. If `expression` is specified, `name` can be any string that you would like. For example if `expression` is `screenPageViews/sessions`, you could call that metric&#x27;s name = `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`.
545 },
546 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800547 &quot;offset&quot;: &quot;A String&quot;, # The row count of the start row. The first row is counted as row 0.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800548 &quot;orderBys&quot;: [ # Specifies how rows are ordered in the response.
549 { # The sort options.
550 &quot;desc&quot;: True or False, # If true, sorts by descending order.
551 &quot;dimension&quot;: { # Sorts by dimension values. # Sorts results by a dimension&#x27;s values.
552 &quot;dimensionName&quot;: &quot;A String&quot;, # A dimension name in the request to order by.
553 &quot;orderType&quot;: &quot;A String&quot;, # Controls the rule for dimension value ordering.
554 },
555 &quot;metric&quot;: { # Sorts by metric values. # Sorts results by a metric&#x27;s values.
556 &quot;metricName&quot;: &quot;A String&quot;, # A metric name in the request to order by.
557 },
558 &quot;pivot&quot;: { # Sorts by a pivot column group. # Sorts results by a metric&#x27;s values within a pivot column group.
559 &quot;metricName&quot;: &quot;A String&quot;, # In the response to order by, order rows by this column. Must be a metric name from the request.
560 &quot;pivotSelections&quot;: [ # Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row&#x27;s dimension name and value pair.
561 { # A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric&#x27;s value. For example if pivots = {{&quot;browser&quot;, &quot;Chrome&quot;}} and metric_name = &quot;Sessions&quot;, then the rows will be sorted based on Sessions in Chrome. ---------|----------|----------------|----------|---------------- | Chrome | Chrome | Safari | Safari ---------|----------|----------------|----------|---------------- Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions ---------|----------|----------------|----------|---------------- US | 2 | 2 | 3 | 1 ---------|----------|----------------|----------|---------------- Canada | 3 | 1 | 4 | 1 ---------|----------|----------------|----------|----------------
562 &quot;dimensionName&quot;: &quot;A String&quot;, # Must be a dimension name from the request.
563 &quot;dimensionValue&quot;: &quot;A String&quot;, # Order by only when the named dimension is this value.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800564 },
565 ],
566 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800567 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800568 ],
569 &quot;returnPropertyQuota&quot;: True or False, # Toggles whether to return the current state of this Analytics Property&#x27;s quota. Quota is returned in [PropertyQuota](#PropertyQuota).
570 },
571 ],
572}
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700573
574 x__xgafv: string, V1 error format.
575 Allowed values
576 1 - v1 error format
577 2 - v2 error format
578
579Returns:
580 An object of the form:
581
582 { # The batch response containing multiple reports.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800583 &quot;reports&quot;: [ # Individual responses. Each response has a separate report request.
584 { # The response report table corresponding to a request.
585 &quot;dimensionHeaders&quot;: [ # Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
586 { # Describes a dimension column in the report. Dimensions requested in a report produce column entries within rows and DimensionHeaders. However, dimensions used exclusively within filters or expressions do not produce columns in a report; correspondingly, those dimensions do not produce headers.
587 &quot;name&quot;: &quot;A String&quot;, # The dimension&#x27;s name.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800588 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800589 ],
590 &quot;maximums&quot;: [ # If requested, the maximum values of metrics.
591 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
592 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
593 { # The value of a dimension.
594 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
595 },
596 ],
597 &quot;metricValues&quot;: [ # List of requested visible metric values.
598 { # The value of a metric.
599 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
600 },
601 ],
602 },
603 ],
604 &quot;metadata&quot;: { # Response&#x27;s metadata carrying additional information about the report content. # Metadata for the report.
605 &quot;dataLossFromOtherRow&quot;: True or False, # If true, indicates some buckets of dimension combinations are rolled into &quot;(other)&quot; row. This can happen for high cardinality reports.
606 },
607 &quot;metricHeaders&quot;: [ # Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
608 { # Describes a metric column in the report. Visible metrics requested in a report produce column entries within rows and MetricHeaders. However, metrics used exclusively within filters or expressions do not produce columns in a report; correspondingly, those metrics do not produce headers.
609 &quot;name&quot;: &quot;A String&quot;, # The metric&#x27;s name.
610 &quot;type&quot;: &quot;A String&quot;, # The metric&#x27;s data type.
611 },
612 ],
613 &quot;minimums&quot;: [ # If requested, the minimum values of metrics.
614 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
615 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
616 { # The value of a dimension.
617 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
618 },
619 ],
620 &quot;metricValues&quot;: [ # List of requested visible metric values.
621 { # The value of a metric.
622 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
623 },
624 ],
625 },
626 ],
627 &quot;propertyQuota&quot;: { # Current state of all quotas for this Analytics Property. If any quota for a property is exhausted, all requests to that property will return Resource Exhausted errors. # This Analytics Property&#x27;s quota state including this request.
628 &quot;concurrentRequests&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.
629 &quot;consumed&quot;: 42, # Quota consumed by this request.
630 &quot;remaining&quot;: 42, # Quota remaining after this request.
631 },
632 &quot;serverErrorsPerProjectPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.
633 &quot;consumed&quot;: 42, # Quota consumed by this request.
634 &quot;remaining&quot;: 42, # Quota remaining after this request.
635 },
636 &quot;tokensPerDay&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 25,000 tokens per day; Analytics 360 Properties can use 250,000 tokens per day. Most requests consume fewer than 10 tokens.
637 &quot;consumed&quot;: 42, # Quota consumed by this request.
638 &quot;remaining&quot;: 42, # Quota remaining after this request.
639 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800640 &quot;tokensPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from both the hourly and daily quotas.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800641 &quot;consumed&quot;: 42, # Quota consumed by this request.
642 &quot;remaining&quot;: 42, # Quota remaining after this request.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800643 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700644 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800645 &quot;rowCount&quot;: 42, # The total number of rows in the query result, regardless of the number of rows returned in the response. For example if a query returns 175 rows and includes limit = 50 in the API request, the response will contain row_count = 175 but only 50 rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
646 &quot;rows&quot;: [ # Rows of dimension value combinations and metric values in the report.
647 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
648 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
649 { # The value of a dimension.
650 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
651 },
652 ],
653 &quot;metricValues&quot;: [ # List of requested visible metric values.
654 { # The value of a metric.
655 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
656 },
657 ],
658 },
659 ],
660 &quot;totals&quot;: [ # If requested, the totaled values of metrics.
661 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
662 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
663 { # The value of a dimension.
664 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
665 },
666 ],
667 &quot;metricValues&quot;: [ # List of requested visible metric values.
668 { # The value of a metric.
669 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
670 },
671 ],
672 },
673 ],
674 },
675 ],
676}</pre>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700677</div>
678
679<div class="method">
680 <code class="details" id="close">close()</code>
681 <pre>Close httplib2 connections.</pre>
682</div>
683
684<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700685 <code class="details" id="runPivotReport">runPivotReport(body=None, x__xgafv=None)</code>
686 <pre>Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
687
688Args:
689 body: object, The request body.
690 The object takes the form of:
691
692{ # The request to generate a pivot report.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800693 &quot;cohortSpec&quot;: { # The specification of cohorts for a cohort report. Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the `cohort` object. Following that cohort for the next six weeks is specified in the `cohortsRange` object. For examples, see [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. # Cohort group associated with this request. If there is a cohort group in the request the &#x27;cohort&#x27; dimension must be present.
694 &quot;cohortReportSettings&quot;: { # Optional settings of a cohort report. # Optional settings for a cohort report.
695 &quot;accumulate&quot;: True or False, # If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800696 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800697 &quot;cohorts&quot;: [ # Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.
698 { # Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same `firstSessionDate` belong to the same cohort.
699 &quot;dateRange&quot;: { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges. # The cohort selects users whose first touch date is between start date and end date defined in the `dateRange`. This `dateRange` does not specify the full date range of event data that is present in a cohort report. In a cohort report, this `dateRange` is extended by the granularity and offset present in the `cohortsRange`; event data for the extended reporting date range is present in a cohort report. In a cohort request, this `dateRange` is required and the `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. This `dateRange` should generally be aligned with the cohort&#x27;s granularity. If `CohortsRange` uses daily granularity, this `dateRange` can be a single day. If `CohortsRange` uses weekly granularity, this `dateRange` can be aligned to a week boundary, starting at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to a month, starting at the first and ending on the last day of the month.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800700 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800701 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800702 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
703 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800704 &quot;dimension&quot;: &quot;A String&quot;, # Dimension used by the cohort. Required and only supports `firstSessionDate`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800705 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this cohort. The dimension `cohort` is valued to this name in a report response. If set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero based index `cohort_0`, `cohort_1`, etc.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800706 },
707 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800708 &quot;cohortsRange&quot;: { # Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over. # Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.
709 &quot;endOffset&quot;: 42, # Required. `endOffset` specifies the end date of the extended reporting date range for a cohort report. `endOffset` can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods. If `granularity` is `DAILY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset` days. If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 7` days. If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 30` days.
710 &quot;granularity&quot;: &quot;A String&quot;, # Required. The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report.
711 &quot;startOffset&quot;: 42, # `startOffset` specifies the start date of the extended reporting date range for a cohort report. `startOffset` is commonly set to 0 so that reports contain data from the acquisition of the cohort forward. If `granularity` is `DAILY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 30` days.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800712 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800713 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800714 &quot;currencyCode&quot;: &quot;A String&quot;, # A currency code in ISO4217 format, such as &quot;AED&quot;, &quot;USD&quot;, &quot;JPY&quot;. If the field is empty, the report uses the entity&#x27;s default currency.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800715 &quot;dateRanges&quot;: [ # The date range to retrieve event data for the report. If multiple date ranges are specified, event data from each date range is used in the report. A special dimension with field name &quot;dateRange&quot; can be included in a Pivot&#x27;s field names; if included, the report compares between date ranges. In a cohort request, this `dateRanges` must be unspecified.
716 { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800717 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800718 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800719 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
720 },
721 ],
722 &quot;dimensionFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800723 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
724 &quot;expressions&quot;: [ # A list of filter expressions.
725 # Object with schema name: FilterExpression
726 ],
727 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800728 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800729 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800730 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
731 &quot;doubleValue&quot;: 3.14, # Double value
732 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
733 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800734 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
735 &quot;doubleValue&quot;: 3.14, # Double value
736 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
737 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800738 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800739 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
740 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800741 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800742 &quot;values&quot;: [ # The list of string values. Must be non-empty.
743 &quot;A String&quot;,
744 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800745 },
746 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
747 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
748 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
749 &quot;doubleValue&quot;: 3.14, # Double value
750 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
751 },
752 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800753 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800754 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800755 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
756 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800757 },
758 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800759 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800760 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
761 &quot;expressions&quot;: [ # A list of filter expressions.
762 # Object with schema name: FilterExpression
763 ],
764 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800765 },
766 &quot;dimensions&quot;: [ # The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
767 { # Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, city could be &quot;Paris&quot; or &quot;New York&quot;. Requests are allowed up to 8 dimensions.
768 &quot;dimensionExpression&quot;: { # Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2). # One dimension can be the result of an expression of multiple dimensions. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
769 &quot;concatenate&quot;: { # Used to combine dimension values to a single dimension. # Used to combine dimension values to a single dimension. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
770 &quot;delimiter&quot;: &quot;A String&quot;, # The delimiter placed between dimension names. Delimiters are often single characters such as &quot;|&quot; or &quot;,&quot; but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = &quot;US,FR&quot;, dimension 2 value = &quot;JP&quot;, and delimiter = &quot;,&quot;, then the response will contain &quot;US,FR,JP&quot;.
771 &quot;dimensionNames&quot;: [ # Names of dimensions. The names must refer back to names in the dimensions field of the request.
772 &quot;A String&quot;,
773 ],
774 },
775 &quot;lowerCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to lower case.
776 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
777 },
778 &quot;upperCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to upper case.
779 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
780 },
781 },
782 &quot;name&quot;: &quot;A String&quot;, # The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names. If `dimensionExpression` is specified, `name` can be any string that you would like. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`.
783 },
784 ],
785 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. Within a batch request, this entity should either be unspecified or consistent with the batch-level entity.
786 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
787 },
788 &quot;keepEmptyRows&quot;: True or False, # If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
789 &quot;metricFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800790 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
791 &quot;expressions&quot;: [ # A list of filter expressions.
792 # Object with schema name: FilterExpression
793 ],
794 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800795 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
796 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
797 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
798 &quot;doubleValue&quot;: 3.14, # Double value
799 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
800 },
801 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
802 &quot;doubleValue&quot;: 3.14, # Double value
803 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
804 },
805 },
806 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
807 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
808 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
809 &quot;values&quot;: [ # The list of string values. Must be non-empty.
810 &quot;A String&quot;,
811 ],
812 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800813 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
814 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
815 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
816 &quot;doubleValue&quot;: 3.14, # Double value
817 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
818 },
819 },
820 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
821 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
822 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
823 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
824 },
825 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800826 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800827 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
828 &quot;expressions&quot;: [ # A list of filter expressions.
829 # Object with schema name: FilterExpression
830 ],
831 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800832 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800833 &quot;metrics&quot;: [ # The metrics requested, at least one metric needs to be specified. All defined metrics must be used by one of the following: metric_expression, metric_filter, order_bys.
834 { # The quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800835 &quot;expression&quot;: &quot;A String&quot;, # A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800836 &quot;invisible&quot;: True or False, # Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`.
837 &quot;name&quot;: &quot;A String&quot;, # The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names. If `expression` is specified, `name` can be any string that you would like. For example if `expression` is `screenPageViews/sessions`, you could call that metric&#x27;s name = `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800838 },
839 ],
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800840 &quot;pivots&quot;: [ # Describes the visual format of the report&#x27;s dimensions in columns or rows. The union of the fieldNames (dimension names) in all pivots must be a subset of dimension names defined in Dimensions. No two pivots can share a dimension. A dimension is only visible if it appears in a pivot.
841 { # Describes the visible dimension columns and rows in the report response.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800842 &quot;fieldNames&quot;: [ # Dimension names for visible columns in the report response. Including &quot;dateRange&quot; produces a date range column; for each row in the response, dimension values in the date range column will indicate the corresponding date range from the request.
843 &quot;A String&quot;,
844 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800845 &quot;limit&quot;: &quot;A String&quot;, # The number of rows to return in this pivot. If the `limit` parameter is unspecified, up to 10,000 rows are returned. The product of the `limit` for each `pivot` in a `RunPivotReportRequest` must not exceed 100,000. For example, a two pivot request with `limit: 1000` in each pivot will fail because the product is `1,000,000`.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800846 &quot;metricAggregations&quot;: [ # Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800847 &quot;A String&quot;,
848 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800849 &quot;offset&quot;: &quot;A String&quot;, # The row count of the start row. The first row is counted as row 0.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800850 &quot;orderBys&quot;: [ # Specifies how dimensions are ordered in the pivot. In the first Pivot, the OrderBys determine Row and PivotDimensionHeader ordering; in subsequent Pivots, the OrderBys determine only PivotDimensionHeader ordering. Dimensions specified in these OrderBys must be a subset of Pivot.field_names.
851 { # The sort options.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800852 &quot;desc&quot;: True or False, # If true, sorts by descending order.
853 &quot;dimension&quot;: { # Sorts by dimension values. # Sorts results by a dimension&#x27;s values.
854 &quot;dimensionName&quot;: &quot;A String&quot;, # A dimension name in the request to order by.
855 &quot;orderType&quot;: &quot;A String&quot;, # Controls the rule for dimension value ordering.
856 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800857 &quot;metric&quot;: { # Sorts by metric values. # Sorts results by a metric&#x27;s values.
858 &quot;metricName&quot;: &quot;A String&quot;, # A metric name in the request to order by.
859 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800860 &quot;pivot&quot;: { # Sorts by a pivot column group. # Sorts results by a metric&#x27;s values within a pivot column group.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800861 &quot;metricName&quot;: &quot;A String&quot;, # In the response to order by, order rows by this column. Must be a metric name from the request.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800862 &quot;pivotSelections&quot;: [ # Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row&#x27;s dimension name and value pair.
863 { # A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric&#x27;s value. For example if pivots = {{&quot;browser&quot;, &quot;Chrome&quot;}} and metric_name = &quot;Sessions&quot;, then the rows will be sorted based on Sessions in Chrome. ---------|----------|----------------|----------|---------------- | Chrome | Chrome | Safari | Safari ---------|----------|----------------|----------|---------------- Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions ---------|----------|----------------|----------|---------------- US | 2 | 2 | 3 | 1 ---------|----------|----------------|----------|---------------- Canada | 3 | 1 | 4 | 1 ---------|----------|----------------|----------|----------------
864 &quot;dimensionName&quot;: &quot;A String&quot;, # Must be a dimension name from the request.
865 &quot;dimensionValue&quot;: &quot;A String&quot;, # Order by only when the named dimension is this value.
866 },
867 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800868 },
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800869 },
870 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700871 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800872 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800873 &quot;returnPropertyQuota&quot;: True or False, # Toggles whether to return the current state of this Analytics Property&#x27;s quota. Quota is returned in [PropertyQuota](#PropertyQuota).
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800874}
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700875
876 x__xgafv: string, V1 error format.
877 Allowed values
878 1 - v1 error format
879 2 - v2 error format
880
881Returns:
882 An object of the form:
883
884 { # The response pivot report table corresponding to a pivot request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800885 &quot;aggregates&quot;: [ # Aggregation of metric values. Can be totals, minimums, or maximums. The returned aggregations are controlled by the metric_aggregations in the pivot. The type of aggregation returned in each row is shown by the dimension_values which are set to &quot;RESERVED_&quot;.
886 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
887 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
888 { # The value of a dimension.
889 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
890 },
891 ],
892 &quot;metricValues&quot;: [ # List of requested visible metric values.
893 { # The value of a metric.
894 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
895 },
896 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800897 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800898 ],
899 &quot;dimensionHeaders&quot;: [ # Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
900 { # Describes a dimension column in the report. Dimensions requested in a report produce column entries within rows and DimensionHeaders. However, dimensions used exclusively within filters or expressions do not produce columns in a report; correspondingly, those dimensions do not produce headers.
901 &quot;name&quot;: &quot;A String&quot;, # The dimension&#x27;s name.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800902 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800903 ],
904 &quot;metadata&quot;: { # Response&#x27;s metadata carrying additional information about the report content. # Metadata for the report.
905 &quot;dataLossFromOtherRow&quot;: True or False, # If true, indicates some buckets of dimension combinations are rolled into &quot;(other)&quot; row. This can happen for high cardinality reports.
906 },
907 &quot;metricHeaders&quot;: [ # Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
908 { # Describes a metric column in the report. Visible metrics requested in a report produce column entries within rows and MetricHeaders. However, metrics used exclusively within filters or expressions do not produce columns in a report; correspondingly, those metrics do not produce headers.
909 &quot;name&quot;: &quot;A String&quot;, # The metric&#x27;s name.
910 &quot;type&quot;: &quot;A String&quot;, # The metric&#x27;s data type.
911 },
912 ],
913 &quot;pivotHeaders&quot;: [ # Summarizes the columns and rows created by a pivot. Each pivot in the request produces one header in the response. If we have a request like this: &quot;pivots&quot;: [{ &quot;fieldNames&quot;: [&quot;country&quot;, &quot;city&quot;] }, { &quot;fieldNames&quot;: &quot;eventName&quot; }] We will have the following `pivotHeaders` in the response: &quot;pivotHeaders&quot; : [{ &quot;dimensionHeaders&quot;: [{ &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;United Kingdom&quot; }, { &quot;value&quot;: &quot;London&quot; } ] }, { &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;Japan&quot; }, { &quot;value&quot;: &quot;Osaka&quot; } ] }] }, { &quot;dimensionHeaders&quot;: [{ &quot;dimensionValues&quot;: [{ &quot;value&quot;: &quot;session_start&quot; }] }, { &quot;dimensionValues&quot;: [{ &quot;value&quot;: &quot;scroll&quot; }] }] }]
914 { # Dimensions&#x27; values in a single pivot.
915 &quot;pivotDimensionHeaders&quot;: [ # The size is the same as the cardinality of the corresponding dimension combinations.
916 { # Summarizes dimension values from a row for this pivot.
917 &quot;dimensionValues&quot;: [ # Values of multiple dimensions in a pivot.
918 { # The value of a dimension.
919 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
920 },
921 ],
922 },
923 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800924 &quot;rowCount&quot;: 42, # The cardinality of the pivot. The total number of rows for this pivot&#x27;s fields regardless of how the parameters `offset` and `limit` are specified in the request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800925 },
926 ],
927 &quot;propertyQuota&quot;: { # Current state of all quotas for this Analytics Property. If any quota for a property is exhausted, all requests to that property will return Resource Exhausted errors. # This Analytics Property&#x27;s quota state including this request.
928 &quot;concurrentRequests&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.
929 &quot;consumed&quot;: 42, # Quota consumed by this request.
930 &quot;remaining&quot;: 42, # Quota remaining after this request.
931 },
932 &quot;serverErrorsPerProjectPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.
933 &quot;consumed&quot;: 42, # Quota consumed by this request.
934 &quot;remaining&quot;: 42, # Quota remaining after this request.
935 },
936 &quot;tokensPerDay&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 25,000 tokens per day; Analytics 360 Properties can use 250,000 tokens per day. Most requests consume fewer than 10 tokens.
937 &quot;consumed&quot;: 42, # Quota consumed by this request.
938 &quot;remaining&quot;: 42, # Quota remaining after this request.
939 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800940 &quot;tokensPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from both the hourly and daily quotas.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800941 &quot;consumed&quot;: 42, # Quota consumed by this request.
942 &quot;remaining&quot;: 42, # Quota remaining after this request.
943 },
944 },
945 &quot;rows&quot;: [ # Rows of dimension value combinations and metric values in the report.
946 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
947 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
948 { # The value of a dimension.
949 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
950 },
951 ],
952 &quot;metricValues&quot;: [ # List of requested visible metric values.
953 { # The value of a metric.
954 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
955 },
956 ],
957 },
958 ],
959}</pre>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700960</div>
961
962<div class="method">
963 <code class="details" id="runReport">runReport(body=None, x__xgafv=None)</code>
964 <pre>Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.
965
966Args:
967 body: object, The request body.
968 The object takes the form of:
969
970{ # The request to generate a report.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800971 &quot;cohortSpec&quot;: { # The specification of cohorts for a cohort report. Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the `cohort` object. Following that cohort for the next six weeks is specified in the `cohortsRange` object. For examples, see [Cohort Report Examples](https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report. # Cohort group associated with this request. If there is a cohort group in the request the &#x27;cohort&#x27; dimension must be present.
972 &quot;cohortReportSettings&quot;: { # Optional settings of a cohort report. # Optional settings for a cohort report.
973 &quot;accumulate&quot;: True or False, # If true, accumulates the result from first touch day to the end day. Not supported in `RunReportRequest`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800974 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800975 &quot;cohorts&quot;: [ # Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.
976 { # Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same `firstSessionDate` belong to the same cohort.
977 &quot;dateRange&quot;: { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges. # The cohort selects users whose first touch date is between start date and end date defined in the `dateRange`. This `dateRange` does not specify the full date range of event data that is present in a cohort report. In a cohort report, this `dateRange` is extended by the granularity and offset present in the `cohortsRange`; event data for the extended reporting date range is present in a cohort report. In a cohort request, this `dateRange` is required and the `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` must be unspecified. This `dateRange` should generally be aligned with the cohort&#x27;s granularity. If `CohortsRange` uses daily granularity, this `dateRange` can be a single day. If `CohortsRange` uses weekly granularity, this `dateRange` can be aligned to a week boundary, starting at Sunday and ending Saturday. If `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to a month, starting at the first and ending on the last day of the month.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800978 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
979 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
980 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800981 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800982 &quot;dimension&quot;: &quot;A String&quot;, # Dimension used by the cohort. Required and only supports `firstSessionDate`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800983 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this cohort. The dimension `cohort` is valued to this name in a report response. If set, cannot begin with `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero based index `cohort_0`, `cohort_1`, etc.
984 },
985 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800986 &quot;cohortsRange&quot;: { # Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over. # Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.
987 &quot;endOffset&quot;: 42, # Required. `endOffset` specifies the end date of the extended reporting date range for a cohort report. `endOffset` can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods. If `granularity` is `DAILY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset` days. If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 7` days. If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date range is `endDate` of the cohort plus `endOffset * 30` days.
988 &quot;granularity&quot;: &quot;A String&quot;, # Required. The granularity used to interpret the `startOffset` and `endOffset` for the extended reporting date range for a cohort report.
989 &quot;startOffset&quot;: 42, # `startOffset` specifies the start date of the extended reporting date range for a cohort report. `startOffset` is commonly set to 0 so that reports contain data from the acquisition of the cohort forward. If `granularity` is `DAILY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 7` days. If `granularity` is `MONTHLY`, the `startDate` of the extended reporting date range is `startDate` of the cohort plus `startOffset * 30` days.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800990 },
991 },
992 &quot;currencyCode&quot;: &quot;A String&quot;, # A currency code in ISO4217 format, such as &quot;AED&quot;, &quot;USD&quot;, &quot;JPY&quot;. If the field is empty, the report uses the entity&#x27;s default currency.
993 &quot;dateRanges&quot;: [ # Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this `dateRanges` must be unspecified.
994 { # A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests are allowed up to 4 date ranges.
995 &quot;endDate&quot;: &quot;A String&quot;, # The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
996 &quot;name&quot;: &quot;A String&quot;, # Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc.
997 &quot;startDate&quot;: &quot;A String&quot;, # The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property&#x27;s reporting time zone.
998 },
999 ],
1000 &quot;dimensionFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
1001 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
1002 &quot;expressions&quot;: [ # A list of filter expressions.
1003 # Object with schema name: FilterExpression
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001004 ],
1005 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001006 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
1007 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
1008 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
1009 &quot;doubleValue&quot;: 3.14, # Double value
1010 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
1011 },
1012 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
1013 &quot;doubleValue&quot;: 3.14, # Double value
1014 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
1015 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001016 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001017 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
1018 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
1019 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
1020 &quot;values&quot;: [ # The list of string values. Must be non-empty.
1021 &quot;A String&quot;,
1022 ],
1023 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001024 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
1025 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
1026 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
1027 &quot;doubleValue&quot;: 3.14, # Double value
1028 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001029 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001030 },
1031 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
1032 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
1033 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
1034 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
1035 },
1036 },
1037 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
1038 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
1039 &quot;expressions&quot;: [ # A list of filter expressions.
1040 # Object with schema name: FilterExpression
1041 ],
1042 },
1043 },
1044 &quot;dimensions&quot;: [ # The dimensions requested and displayed.
1045 { # Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, city could be &quot;Paris&quot; or &quot;New York&quot;. Requests are allowed up to 8 dimensions.
1046 &quot;dimensionExpression&quot;: { # Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2). # One dimension can be the result of an expression of multiple dimensions. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
1047 &quot;concatenate&quot;: { # Used to combine dimension values to a single dimension. # Used to combine dimension values to a single dimension. For example, dimension &quot;country, city&quot;: concatenate(country, &quot;, &quot;, city).
1048 &quot;delimiter&quot;: &quot;A String&quot;, # The delimiter placed between dimension names. Delimiters are often single characters such as &quot;|&quot; or &quot;,&quot; but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = &quot;US,FR&quot;, dimension 2 value = &quot;JP&quot;, and delimiter = &quot;,&quot;, then the response will contain &quot;US,FR,JP&quot;.
1049 &quot;dimensionNames&quot;: [ # Names of dimensions. The names must refer back to names in the dimensions field of the request.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -08001050 &quot;A String&quot;,
1051 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001052 },
1053 &quot;lowerCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to lower case.
1054 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
1055 },
1056 &quot;upperCase&quot;: { # Used to convert a dimension value to a single case. # Used to convert a dimension value to upper case.
1057 &quot;dimensionName&quot;: &quot;A String&quot;, # Name of a dimension. The name must refer back to a name in dimensions field of the request.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -08001058 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001059 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001060 &quot;name&quot;: &quot;A String&quot;, # The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names. If `dimensionExpression` is specified, `name` can be any string that you would like. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -08001061 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001062 ],
1063 &quot;entity&quot;: { # The unique identifier of the property whose events are tracked. # A property whose events are tracked. Within a batch request, this entity should either be unspecified or consistent with the batch-level entity.
1064 &quot;propertyId&quot;: &quot;A String&quot;, # A Google Analytics GA4 property id. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
1065 },
1066 &quot;keepEmptyRows&quot;: True or False, # If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001067 &quot;limit&quot;: &quot;A String&quot;, # The number of rows to return. If the `limit` parameter is unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001068 &quot;metricAggregations&quot;: [ # Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to &quot;RESERVED_(MetricAggregation)&quot;.
1069 &quot;A String&quot;,
1070 ],
1071 &quot;metricFilter&quot;: { # To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics. # The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
1072 &quot;andGroup&quot;: { # A list of filter expressions. # The FilterExpressions in and_group have an AND relationship.
1073 &quot;expressions&quot;: [ # A list of filter expressions.
1074 # Object with schema name: FilterExpression
1075 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001076 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001077 &quot;filter&quot;: { # An expression to filter dimension or metric values. # A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
1078 &quot;betweenFilter&quot;: { # To express that the result needs to be between two numbers (inclusive). # A filter for two values.
1079 &quot;fromValue&quot;: { # To represent a number. # Begins with this number.
1080 &quot;doubleValue&quot;: 3.14, # Double value
1081 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001082 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001083 &quot;toValue&quot;: { # To represent a number. # Ends with this number.
1084 &quot;doubleValue&quot;: 3.14, # Double value
1085 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001086 },
Yoshi Automation Botb6971b02020-11-26 17:16:03 -08001087 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001088 &quot;fieldName&quot;: &quot;A String&quot;, # The dimension name or metric name. Must be a name defined in dimensions or metrics.
1089 &quot;inListFilter&quot;: { # The result needs to be in a list of string values. # A filter for in list values.
1090 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
1091 &quot;values&quot;: [ # The list of string values. Must be non-empty.
1092 &quot;A String&quot;,
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001093 ],
1094 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001095 &quot;numericFilter&quot;: { # Filters for numeric or date values. # A filter for numeric or date values.
1096 &quot;operation&quot;: &quot;A String&quot;, # The operation type for this filter.
1097 &quot;value&quot;: { # To represent a number. # A numeric value or a date value.
1098 &quot;doubleValue&quot;: 3.14, # Double value
1099 &quot;int64Value&quot;: &quot;A String&quot;, # Integer value
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001100 },
1101 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001102 &quot;stringFilter&quot;: { # The filter for string # Strings related filter.
1103 &quot;caseSensitive&quot;: True or False, # If true, the string value is case sensitive.
1104 &quot;matchType&quot;: &quot;A String&quot;, # The match type for this filter.
1105 &quot;value&quot;: &quot;A String&quot;, # The string value used for the matching.
1106 },
1107 },
1108 &quot;notExpression&quot;: # Object with schema name: FilterExpression # The FilterExpression is NOT of not_expression.
1109 &quot;orGroup&quot;: { # A list of filter expressions. # The FilterExpressions in or_group have an OR relationship.
1110 &quot;expressions&quot;: [ # A list of filter expressions.
1111 # Object with schema name: FilterExpression
1112 ],
1113 },
1114 },
1115 &quot;metrics&quot;: [ # The metrics requested and displayed.
1116 { # The quantitative measurements of a report. For example, the metric `eventCount` is the total number of events. Requests are allowed up to 10 metrics.
1117 &quot;expression&quot;: &quot;A String&quot;, # A mathematical expression for derived metrics. For example, the metric Event count per user is `eventCount/totalUsers`.
1118 &quot;invisible&quot;: True or False, # Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in `metricFilter`, `orderBys`, or a metric `expression`.
1119 &quot;name&quot;: &quot;A String&quot;, # The name of the metric. See the [API Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) for the list of metric names. If `expression` is specified, `name` can be any string that you would like. For example if `expression` is `screenPageViews/sessions`, you could call that metric&#x27;s name = `viewsPerSession`. Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric `expression`.
1120 },
1121 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001122 &quot;offset&quot;: &quot;A String&quot;, # The row count of the start row. The first row is counted as row 0.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001123 &quot;orderBys&quot;: [ # Specifies how rows are ordered in the response.
1124 { # The sort options.
1125 &quot;desc&quot;: True or False, # If true, sorts by descending order.
1126 &quot;dimension&quot;: { # Sorts by dimension values. # Sorts results by a dimension&#x27;s values.
1127 &quot;dimensionName&quot;: &quot;A String&quot;, # A dimension name in the request to order by.
1128 &quot;orderType&quot;: &quot;A String&quot;, # Controls the rule for dimension value ordering.
1129 },
1130 &quot;metric&quot;: { # Sorts by metric values. # Sorts results by a metric&#x27;s values.
1131 &quot;metricName&quot;: &quot;A String&quot;, # A metric name in the request to order by.
1132 },
1133 &quot;pivot&quot;: { # Sorts by a pivot column group. # Sorts results by a metric&#x27;s values within a pivot column group.
1134 &quot;metricName&quot;: &quot;A String&quot;, # In the response to order by, order rows by this column. Must be a metric name from the request.
1135 &quot;pivotSelections&quot;: [ # Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row&#x27;s dimension name and value pair.
1136 { # A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric&#x27;s value. For example if pivots = {{&quot;browser&quot;, &quot;Chrome&quot;}} and metric_name = &quot;Sessions&quot;, then the rows will be sorted based on Sessions in Chrome. ---------|----------|----------------|----------|---------------- | Chrome | Chrome | Safari | Safari ---------|----------|----------------|----------|---------------- Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions ---------|----------|----------------|----------|---------------- US | 2 | 2 | 3 | 1 ---------|----------|----------------|----------|---------------- Canada | 3 | 1 | 4 | 1 ---------|----------|----------------|----------|----------------
1137 &quot;dimensionName&quot;: &quot;A String&quot;, # Must be a dimension name from the request.
1138 &quot;dimensionValue&quot;: &quot;A String&quot;, # Order by only when the named dimension is this value.
1139 },
1140 ],
1141 },
1142 },
1143 ],
1144 &quot;returnPropertyQuota&quot;: True or False, # Toggles whether to return the current state of this Analytics Property&#x27;s quota. Quota is returned in [PropertyQuota](#PropertyQuota).
1145}
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001146
1147 x__xgafv: string, V1 error format.
1148 Allowed values
1149 1 - v1 error format
1150 2 - v2 error format
1151
1152Returns:
1153 An object of the form:
1154
1155 { # The response report table corresponding to a request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001156 &quot;dimensionHeaders&quot;: [ # Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
1157 { # Describes a dimension column in the report. Dimensions requested in a report produce column entries within rows and DimensionHeaders. However, dimensions used exclusively within filters or expressions do not produce columns in a report; correspondingly, those dimensions do not produce headers.
1158 &quot;name&quot;: &quot;A String&quot;, # The dimension&#x27;s name.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001159 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001160 ],
1161 &quot;maximums&quot;: [ # If requested, the maximum values of metrics.
1162 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
1163 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
1164 { # The value of a dimension.
1165 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
1166 },
1167 ],
1168 &quot;metricValues&quot;: [ # List of requested visible metric values.
1169 { # The value of a metric.
1170 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
1171 },
1172 ],
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -08001173 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001174 ],
1175 &quot;metadata&quot;: { # Response&#x27;s metadata carrying additional information about the report content. # Metadata for the report.
1176 &quot;dataLossFromOtherRow&quot;: True or False, # If true, indicates some buckets of dimension combinations are rolled into &quot;(other)&quot; row. This can happen for high cardinality reports.
1177 },
1178 &quot;metricHeaders&quot;: [ # Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
1179 { # Describes a metric column in the report. Visible metrics requested in a report produce column entries within rows and MetricHeaders. However, metrics used exclusively within filters or expressions do not produce columns in a report; correspondingly, those metrics do not produce headers.
1180 &quot;name&quot;: &quot;A String&quot;, # The metric&#x27;s name.
1181 &quot;type&quot;: &quot;A String&quot;, # The metric&#x27;s data type.
1182 },
1183 ],
1184 &quot;minimums&quot;: [ # If requested, the minimum values of metrics.
1185 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
1186 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
1187 { # The value of a dimension.
1188 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
1189 },
1190 ],
1191 &quot;metricValues&quot;: [ # List of requested visible metric values.
1192 { # The value of a metric.
1193 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
1194 },
1195 ],
1196 },
1197 ],
1198 &quot;propertyQuota&quot;: { # Current state of all quotas for this Analytics Property. If any quota for a property is exhausted, all requests to that property will return Resource Exhausted errors. # This Analytics Property&#x27;s quota state including this request.
1199 &quot;concurrentRequests&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.
1200 &quot;consumed&quot;: 42, # Quota consumed by this request.
1201 &quot;remaining&quot;: 42, # Quota remaining after this request.
1202 },
1203 &quot;serverErrorsPerProjectPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.
1204 &quot;consumed&quot;: 42, # Quota consumed by this request.
1205 &quot;remaining&quot;: 42, # Quota remaining after this request.
1206 },
1207 &quot;tokensPerDay&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 25,000 tokens per day; Analytics 360 Properties can use 250,000 tokens per day. Most requests consume fewer than 10 tokens.
1208 &quot;consumed&quot;: 42, # Quota consumed by this request.
1209 &quot;remaining&quot;: 42, # Quota remaining after this request.
1210 },
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001211 &quot;tokensPerHour&quot;: { # Current state for a particular quota group. # Standard Analytics Properties can use up to 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from both the hourly and daily quotas.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001212 &quot;consumed&quot;: 42, # Quota consumed by this request.
1213 &quot;remaining&quot;: 42, # Quota remaining after this request.
1214 },
1215 },
1216 &quot;rowCount&quot;: 42, # The total number of rows in the query result, regardless of the number of rows returned in the response. For example if a query returns 175 rows and includes limit = 50 in the API request, the response will contain row_count = 175 but only 50 rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
1217 &quot;rows&quot;: [ # Rows of dimension value combinations and metric values in the report.
1218 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
1219 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
1220 { # The value of a dimension.
1221 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
1222 },
1223 ],
1224 &quot;metricValues&quot;: [ # List of requested visible metric values.
1225 { # The value of a metric.
1226 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
1227 },
1228 ],
1229 },
1230 ],
1231 &quot;totals&quot;: [ # If requested, the totaled values of metrics.
1232 { # Report data for each row. For example if RunReportRequest contains: ```none &quot;dimensions&quot;: [ { &quot;name&quot;: &quot;eventName&quot; }, { &quot;name&quot;: &quot;countryId&quot; } ], &quot;metrics&quot;: [ { &quot;name&quot;: &quot;eventCount&quot; } ] ``` One row with &#x27;in_app_purchase&#x27; as the eventName, &#x27;JP&#x27; as the countryId, and 15 as the eventCount, would be: ```none &quot;dimensionValues&quot;: [ { &quot;value&quot;: &quot;in_app_purchase&quot; }, { &quot;value&quot;: &quot;JP&quot; } ], &quot;metricValues&quot;: [ { &quot;value&quot;: &quot;15&quot; } ] ```
1233 &quot;dimensionValues&quot;: [ # List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
1234 { # The value of a dimension.
1235 &quot;value&quot;: &quot;A String&quot;, # Value as a string if the dimension type is a string.
1236 },
1237 ],
1238 &quot;metricValues&quot;: [ # List of requested visible metric values.
1239 { # The value of a metric.
1240 &quot;value&quot;: &quot;A String&quot;, # Measurement value. See MetricHeader for type.
1241 },
1242 ],
1243 },
1244 ],
1245}</pre>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001246</div>
1247
1248</body></html>