@google-analytics/data 2.7.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // Copyright 2020 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -19,8 +19,6 @@ package google.analytics.data.v1alpha;
19
19
  import "google/analytics/data/v1alpha/data.proto";
20
20
  import "google/api/annotations.proto";
21
21
  import "google/api/client.proto";
22
- import "google/api/field_behavior.proto";
23
- import "google/api/resource.proto";
24
22
 
25
23
  option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data";
26
24
  option java_multiple_files = true;
@@ -34,444 +32,138 @@ service AlphaAnalyticsData {
34
32
  "https://www.googleapis.com/auth/analytics,"
35
33
  "https://www.googleapis.com/auth/analytics.readonly";
36
34
 
37
- // Returns a customized report of your Google Analytics event data. Reports
38
- // contain statistics derived from data collected by the Google Analytics
39
- // tracking code. The data returned from the API is as a table with columns
40
- // for the requested dimensions and metrics. Metrics are individual
41
- // measurements of user activity on your property, such as active users or
42
- // event count. Dimensions break down metrics across some common criteria,
43
- // such as country or event name.
44
- rpc RunReport(RunReportRequest) returns (RunReportResponse) {
45
- option (google.api.http) = {
46
- post: "/v1alpha:runReport"
47
- body: "*"
48
- };
49
- }
50
-
51
- // Returns a customized pivot report of your Google Analytics event data.
52
- // Pivot reports are more advanced and expressive formats than regular
53
- // reports. In a pivot report, dimensions are only visible if they are
54
- // included in a pivot. Multiple pivots can be specified to further dissect
55
- // your data.
56
- rpc RunPivotReport(RunPivotReportRequest) returns (RunPivotReportResponse) {
57
- option (google.api.http) = {
58
- post: "/v1alpha:runPivotReport"
59
- body: "*"
60
- };
61
- }
62
-
63
- // Returns multiple reports in a batch. All reports must be for the same
64
- // Entity.
65
- rpc BatchRunReports(BatchRunReportsRequest) returns (BatchRunReportsResponse) {
66
- option (google.api.http) = {
67
- post: "/v1alpha:batchRunReports"
68
- body: "*"
69
- };
70
- }
71
-
72
- // Returns multiple pivot reports in a batch. All reports must be for the same
73
- // Entity.
74
- rpc BatchRunPivotReports(BatchRunPivotReportsRequest) returns (BatchRunPivotReportsResponse) {
75
- option (google.api.http) = {
76
- post: "/v1alpha:batchRunPivotReports"
77
- body: "*"
78
- };
79
- }
80
-
81
- // Returns metadata for dimensions and metrics available in reporting methods.
82
- // Used to explore the dimensions and metrics. In this method, a Google
83
- // Analytics GA4 Property Identifier is specified in the request, and
84
- // the metadata response includes Custom dimensions and metrics as well as
85
- // Universal metadata.
35
+ // Returns a customized funnel report of your Google Analytics event data. The
36
+ // data returned from the API is as a table with columns for the requested
37
+ // dimensions and metrics.
86
38
  //
87
- // For example if a custom metric with parameter name `levels_unlocked` is
88
- // registered to a property, the Metadata response will contain
89
- // `customEvent:levels_unlocked`. Universal metadata are dimensions and
90
- // metrics applicable to any property such as `country` and `totalUsers`.
91
- rpc GetMetadata(GetMetadataRequest) returns (Metadata) {
39
+ // Funnel exploration lets you visualize the steps your users take to complete
40
+ // a task and quickly see how well they are succeeding or failing at each
41
+ // step. For example, how do prospects become shoppers and then become buyers?
42
+ // How do one time buyers become repeat buyers? With this information, you can
43
+ // improve inefficient or abandoned customer journeys. To learn more, see [GA4
44
+ // Funnel Explorations](https://support.google.com/analytics/answer/9327974).
45
+ rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) {
92
46
  option (google.api.http) = {
93
- get: "/v1alpha/{name=properties/*/metadata}"
94
- };
95
- option (google.api.method_signature) = "name";
96
- }
97
-
98
- // The Google Analytics Realtime API returns a customized report of realtime
99
- // event data for your property. These reports show events and usage from the
100
- // last 30 minutes.
101
- rpc RunRealtimeReport(RunRealtimeReportRequest) returns (RunRealtimeReportResponse) {
102
- option (google.api.http) = {
103
- post: "/v1alpha/{property=properties/*}:runRealtimeReport"
47
+ post: "/v1alpha/{property=properties/*}:runFunnelReport"
104
48
  body: "*"
105
49
  };
106
50
  }
107
51
  }
108
52
 
109
- // The dimensions and metrics currently accepted in reporting methods.
110
- message Metadata {
111
- option (google.api.resource) = {
112
- type: "analyticsdata.googleapis.com/Metadata"
113
- pattern: "properties/{property}/metadata"
114
- };
115
-
116
- // Resource name of this metadata.
117
- string name = 3;
118
-
119
- // The dimension descriptions.
120
- repeated DimensionMetadata dimensions = 1;
121
-
122
- // The metric descriptions.
123
- repeated MetricMetadata metrics = 2;
124
- }
125
-
126
- // The request to generate a report.
127
- message RunReportRequest {
128
- // A property whose events are tracked. Within a batch request, this entity
129
- // should either be unspecified or consistent with the batch-level entity.
130
- Entity entity = 1;
131
-
132
- // The dimensions requested and displayed.
133
- repeated Dimension dimensions = 2;
53
+ // The request for a funnel report.
54
+ message RunFunnelReportRequest {
55
+ // Controls the dimensions present in the funnel visualization sub report
56
+ // response.
57
+ enum FunnelVisualizationType {
58
+ // Unspecified type.
59
+ FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0;
60
+
61
+ // A standard (stepped) funnel. The funnel visualization sub report in the
62
+ // response will not contain date.
63
+ STANDARD_FUNNEL = 1;
64
+
65
+ // A trended (line chart) funnel. The funnel visualization sub report in the
66
+ // response will contain the date dimension.
67
+ TRENDED_FUNNEL = 2;
68
+ }
134
69
 
135
- // The metrics requested and displayed.
136
- repeated Metric metrics = 3;
70
+ // A Google Analytics GA4 property identifier whose events are tracked.
71
+ // Specified in the URL path and not the body. To learn more, see [where to
72
+ // find your Property
73
+ // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
74
+ // Within a batch request, this property should either be unspecified or
75
+ // consistent with the batch-level property.
76
+ //
77
+ // Example: properties/1234
78
+ string property = 1;
137
79
 
138
80
  // Date ranges of data to read. If multiple date ranges are requested, each
139
81
  // response row will contain a zero based date range index. If two date
140
82
  // ranges overlap, the event data for the overlapping days is included in the
141
- // response rows for both date ranges. In a cohort request, this `dateRanges`
142
- // must be unspecified.
143
- repeated DateRange date_ranges = 4;
144
-
145
- // The row count of the start row. The first row is counted as row 0.
146
- //
147
- // To learn more about this pagination parameter, see
148
- // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
149
- int64 offset = 5;
150
-
151
- // The number of rows to return. If unspecified, 10 rows are returned. If
152
- // -1, all rows are returned.
83
+ // response rows for both date ranges.
84
+ repeated DateRange date_ranges = 2;
85
+
86
+ // The configuration of this request's funnel. This funnel configuration is
87
+ // required.
88
+ Funnel funnel = 3;
89
+
90
+ // If specified, this breakdown adds a dimension to the funnel table sub
91
+ // report response. This breakdown dimension expands each funnel step to the
92
+ // unique values of the breakdown dimension. For example, a breakdown by the
93
+ // `deviceCategory` dimension will create rows for `mobile`, `tablet`,
94
+ // `desktop`, and the total.
95
+ FunnelBreakdown funnel_breakdown = 4;
96
+
97
+ // If specified, next action adds a dimension to the funnel visualization sub
98
+ // report response. This next action dimension expands each funnel step to the
99
+ // unique values of the next action. For example a next action of the
100
+ // `eventName` dimension will create rows for several events (i.e.
101
+ // `session_start` & `click`) and the total.
153
102
  //
154
- // To learn more about this pagination parameter, see
155
- // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
156
- int64 limit = 6;
157
-
158
- // Aggregation of metrics. Aggregated metric values will be shown in rows
159
- // where the dimension_values are set to "RESERVED_(MetricAggregation)".
160
- repeated MetricAggregation metric_aggregations = 7;
161
-
162
- // The filter clause of dimensions. Dimensions must be requested to be used in
163
- // this filter. Metrics cannot be used in this filter.
164
- FilterExpression dimension_filter = 8;
165
-
166
- // The filter clause of metrics. Applied at post aggregation phase, similar to
167
- // SQL having-clause. Metrics must be requested to be used in this filter.
168
- // Dimensions cannot be used in this filter.
169
- FilterExpression metric_filter = 9;
170
-
171
- // Specifies how rows are ordered in the response.
172
- repeated OrderBy order_bys = 10;
103
+ // Next action only supports `eventName` and most Page / Screen dimensions
104
+ // like `pageTitle` and `pagePath`.
105
+ FunnelNextAction funnel_next_action = 5;
173
106
 
174
- // A currency code in ISO4217 format, such as "AED", "USD", "JPY".
175
- // If the field is empty, the report uses the entity's default currency.
176
- string currency_code = 11;
107
+ // The funnel visualization type controls the dimensions present in the funnel
108
+ // visualization sub report response. If not specified, `STANDARD_FUNNEL` is
109
+ // used.
110
+ FunnelVisualizationType funnel_visualization_type = 6;
177
111
 
178
- // Cohort group associated with this request. If there is a cohort group
179
- // in the request the 'cohort' dimension must be present.
180
- CohortSpec cohort_spec = 12;
181
-
182
- // If false or unspecified, each row with all metrics equal to 0 will not be
183
- // returned. If true, these rows will be returned if they are not separately
184
- // removed by a filter.
185
- bool keep_empty_rows = 13;
186
-
187
- // Toggles whether to return the current state of this Analytics Property's
188
- // quota. Quota is returned in [PropertyQuota](#PropertyQuota).
189
- bool return_property_quota = 14;
190
- }
191
-
192
- // The response report table corresponding to a request.
193
- message RunReportResponse {
194
- // Describes dimension columns. The number of DimensionHeaders and ordering of
195
- // DimensionHeaders matches the dimensions present in rows.
196
- repeated DimensionHeader dimension_headers = 11;
197
-
198
- // Describes metric columns. The number of MetricHeaders and ordering of
199
- // MetricHeaders matches the metrics present in rows.
200
- repeated MetricHeader metric_headers = 1;
201
-
202
- // Rows of dimension value combinations and metric values in the report.
203
- repeated Row rows = 2;
204
-
205
- // If requested, the totaled values of metrics.
206
- repeated Row totals = 8;
207
-
208
- // If requested, the maximum values of metrics.
209
- repeated Row maximums = 9;
210
-
211
- // If requested, the minimum values of metrics.
212
- repeated Row minimums = 10;
213
-
214
- // The total number of rows in the query result, regardless of the number of
215
- // rows returned in the response. For example if a query returns 175 rows and
216
- // includes limit = 50 in the API request, the response will contain row_count
217
- // = 175 but only 50 rows.
112
+ // The configurations of segments. Segments are subsets of a property's data.
113
+ // In a funnel report with segments, the funnel is evaluated in each segment.
218
114
  //
219
- // To learn more about this pagination parameter, see
220
- // [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination).
221
- int32 row_count = 12;
222
-
223
- // Metadata for the report.
224
- ResponseMetaData metadata = 6;
225
-
226
- // This Analytics Property's quota state including this request.
227
- PropertyQuota property_quota = 7;
228
- }
229
-
230
- // The request to generate a pivot report.
231
- message RunPivotReportRequest {
232
- // A property whose events are tracked. Within a batch request, this entity
233
- // should either be unspecified or consistent with the batch-level entity.
234
- Entity entity = 1;
235
-
236
- // The dimensions requested. All defined dimensions must be used by one of the
237
- // following: dimension_expression, dimension_filter, pivots, order_bys.
238
- repeated Dimension dimensions = 2;
239
-
240
- // The metrics requested, at least one metric needs to be specified. All
241
- // defined metrics must be used by one of the following: metric_expression,
242
- // metric_filter, order_bys.
243
- repeated Metric metrics = 3;
244
-
245
- // The filter clause of dimensions. Dimensions must be requested to be used in
246
- // this filter. Metrics cannot be used in this filter.
247
- FilterExpression dimension_filter = 4;
248
-
249
- // The filter clause of metrics. Applied at post aggregation phase, similar to
250
- // SQL having-clause. Metrics must be requested to be used in this filter.
251
- // Dimensions cannot be used in this filter.
252
- FilterExpression metric_filter = 5;
253
-
254
- // Describes the visual format of the report's dimensions in columns or rows.
255
- // The union of the fieldNames (dimension names) in all pivots must be a
256
- // subset of dimension names defined in Dimensions. No two pivots can share a
257
- // dimension. A dimension is only visible if it appears in a pivot.
258
- repeated Pivot pivots = 6;
259
-
260
- // The date range to retrieve event data for the report. If multiple date
261
- // ranges are specified, event data from each date range is used in the
262
- // report. A special dimension with field name "dateRange" can be included in
263
- // a Pivot's field names; if included, the report compares between date
264
- // ranges. In a cohort request, this `dateRanges` must be unspecified.
265
- repeated DateRange date_ranges = 7;
266
-
267
- // A currency code in ISO4217 format, such as "AED", "USD", "JPY".
268
- // If the field is empty, the report uses the entity's default currency.
269
- string currency_code = 8;
115
+ // Each segment specified in this request
116
+ // produces a separate row in the response; in the response, each segment
117
+ // identified by its name.
118
+ //
119
+ // The segments parameter is optional. Requests are limited to 4 segments.
120
+ repeated Segment segments = 7;
270
121
 
271
- // Cohort group associated with this request. If there is a cohort group
272
- // in the request the 'cohort' dimension must be present.
273
- CohortSpec cohort_spec = 9;
122
+ // The number of rows to return. If unspecified, 10,000 rows are returned. The
123
+ // API returns a maximum of 100,000 rows per request, no matter how many you
124
+ // ask for. `limit` must be positive.
125
+ //
126
+ // The API can also return fewer rows than the requested `limit`, if there
127
+ // aren't as many dimension values as the `limit`.
128
+ int64 limit = 9;
274
129
 
275
- // If false or unspecified, each row with all metrics equal to 0 will not be
276
- // returned. If true, these rows will be returned if they are not separately
277
- // removed by a filter.
278
- bool keep_empty_rows = 10;
130
+ // Dimension filters allow you to ask for only specific dimension values in
131
+ // the report. To learn more, see [Creating a Report: Dimension
132
+ // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
133
+ // for examples. Metrics cannot be used in this filter.
134
+ FilterExpression dimension_filter = 10;
279
135
 
280
136
  // Toggles whether to return the current state of this Analytics Property's
281
137
  // quota. Quota is returned in [PropertyQuota](#PropertyQuota).
282
- bool return_property_quota = 11;
283
- }
284
-
285
- // The response pivot report table corresponding to a pivot request.
286
- message RunPivotReportResponse {
287
- // Summarizes the columns and rows created by a pivot. Each pivot in the
288
- // request produces one header in the response. If we have a request like
289
- // this:
290
- //
291
- // "pivots": [{
292
- // "fieldNames": ["country",
293
- // "city"]
294
- // },
295
- // {
296
- // "fieldNames": "eventName"
297
- // }]
298
- //
299
- // We will have the following `pivotHeaders` in the response:
300
- //
301
- // "pivotHeaders" : [{
302
- // "dimensionHeaders": [{
303
- // "dimensionValues": [
304
- // { "value": "United Kingdom" },
305
- // { "value": "London" }
306
- // ]
307
- // },
308
- // {
309
- // "dimensionValues": [
310
- // { "value": "Japan" },
311
- // { "value": "Osaka" }
312
- // ]
313
- // }]
314
- // },
315
- // {
316
- // "dimensionHeaders": [{
317
- // "dimensionValues": [{ "value": "session_start" }]
318
- // },
319
- // {
320
- // "dimensionValues": [{ "value": "scroll" }]
321
- // }]
322
- // }]
323
- repeated PivotHeader pivot_headers = 1;
324
-
325
- // Describes dimension columns. The number of DimensionHeaders and ordering of
326
- // DimensionHeaders matches the dimensions present in rows.
327
- repeated DimensionHeader dimension_headers = 7;
328
-
329
- // Describes metric columns. The number of MetricHeaders and ordering of
330
- // MetricHeaders matches the metrics present in rows.
331
- repeated MetricHeader metric_headers = 2;
332
-
333
- // Rows of dimension value combinations and metric values in the report.
334
- repeated Row rows = 3;
335
-
336
- // Aggregation of metric values. Can be totals, minimums, or maximums. The
337
- // returned aggregations are controlled by the metric_aggregations in the
338
- // pivot. The type of aggregation returned in each row is shown by the
339
- // dimension_values which are set to "RESERVED_<MetricAggregation>".
340
- repeated Row aggregates = 4;
341
-
342
- // Metadata for the report.
343
- ResponseMetaData metadata = 5;
344
-
345
- // This Analytics Property's quota state including this request.
346
- PropertyQuota property_quota = 6;
347
- }
348
-
349
- // The batch request containing multiple report requests.
350
- message BatchRunReportsRequest {
351
- // A property whose events are tracked. This entity must be specified for the
352
- // batch. The entity within RunReportRequest may either be unspecified or
353
- // consistent with this entity.
354
- Entity entity = 1;
355
-
356
- // Individual requests. Each request has a separate report response. Each
357
- // batch request is allowed up to 5 requests.
358
- repeated RunReportRequest requests = 2;
359
- }
360
-
361
- // The batch response containing multiple reports.
362
- message BatchRunReportsResponse {
363
- // Individual responses. Each response has a separate report request.
364
- repeated RunReportResponse reports = 1;
365
- }
366
-
367
- // The batch request containing multiple pivot report requests.
368
- message BatchRunPivotReportsRequest {
369
- // A property whose events are tracked. This entity must be specified for the
370
- // batch. The entity within RunPivotReportRequest may either be unspecified or
371
- // consistent with this entity.
372
- Entity entity = 1;
373
-
374
- // Individual requests. Each request has a separate pivot report response.
375
- // Each batch request is allowed up to 5 requests.
376
- repeated RunPivotReportRequest requests = 2;
377
- }
378
-
379
- // The batch response containing multiple pivot reports.
380
- message BatchRunPivotReportsResponse {
381
- // Individual responses. Each response has a separate pivot report request.
382
- repeated RunPivotReportResponse pivot_reports = 1;
138
+ bool return_property_quota = 12;
383
139
  }
384
140
 
385
- // Request for a property's dimension and metric metadata.
386
- message GetMetadataRequest {
387
- // Required. The resource name of the metadata to retrieve. This name field is
388
- // specified in the URL path and not URL parameters. Property is a numeric
389
- // Google Analytics GA4 Property identifier. To learn more, see [where to find
390
- // your Property
391
- // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
141
+ // The funnel report response contains two sub reports. The two sub reports are
142
+ // different combinations of dimensions and metrics.
143
+ message RunFunnelReportResponse {
144
+ // The funnel table is a report with the funnel step, segment, breakdown
145
+ // dimension, active users, completion rate, abandonments, and abandonments
146
+ // rate.
392
147
  //
393
- // Example: properties/1234/metadata
394
- //
395
- // Set the Property ID to 0 for dimensions and metrics common to all
396
- // properties. In this special mode, this method will not return custom
397
- // dimensions and metrics.
398
- string name = 1 [
399
- (google.api.field_behavior) = REQUIRED,
400
- (google.api.resource_reference) = {
401
- type: "analyticsdata.googleapis.com/Metadata"
402
- }
403
- ];
404
- }
148
+ // The segment dimension is only present in this response if a segment was
149
+ // requested. The breakdown dimension is only present in this response if it
150
+ // was requested.
151
+ FunnelSubReport funnel_table = 1;
405
152
 
406
- // The request to generate a realtime report.
407
- message RunRealtimeReportRequest {
408
- // A Google Analytics GA4 property identifier whose events are tracked.
409
- // Specified in the URL path and not the body. To learn more, see [where to
410
- // find your Property
411
- // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
153
+ // The funnel visualization is a report with the funnel step, segment, date,
154
+ // next action dimension, and active users.
412
155
  //
413
- // Example: properties/1234
414
- string property = 1;
415
-
416
- // The dimensions requested and displayed.
417
- repeated Dimension dimensions = 2;
418
-
419
- // The metrics requested and displayed.
420
- repeated Metric metrics = 3;
156
+ // The segment dimension is only present in this response if a segment was
157
+ // requested. The date dimension is only present in this response if it was
158
+ // requested via the `TRENDED_FUNNEL` funnel type. The next action dimension
159
+ // is only present in the response if it was requested.
160
+ FunnelSubReport funnel_visualization = 2;
421
161
 
422
- // The number of rows to return. If unspecified, 10 rows are returned. If
423
- // -1, all rows are returned.
424
- int64 limit = 4;
425
-
426
- // The filter clause of dimensions. Dimensions must be requested to be used in
427
- // this filter. Metrics cannot be used in this filter.
428
- FilterExpression dimension_filter = 5;
429
-
430
- // The filter clause of metrics. Applied at post aggregation phase, similar to
431
- // SQL having-clause. Metrics must be requested to be used in this filter.
432
- // Dimensions cannot be used in this filter.
433
- FilterExpression metric_filter = 6;
434
-
435
- // Aggregation of metrics. Aggregated metric values will be shown in rows
436
- // where the dimension_values are set to "RESERVED_(MetricAggregation)".
437
- repeated MetricAggregation metric_aggregations = 7;
438
-
439
- // Specifies how rows are ordered in the response.
440
- repeated OrderBy order_bys = 8;
441
-
442
- // Toggles whether to return the current state of this Analytics Property's
443
- // Realtime quota. Quota is returned in [PropertyQuota](#PropertyQuota).
444
- bool return_property_quota = 9;
445
- }
446
-
447
- // The response realtime report table corresponding to a request.
448
- message RunRealtimeReportResponse {
449
- // Describes dimension columns. The number of DimensionHeaders and ordering of
450
- // DimensionHeaders matches the dimensions present in rows.
451
- repeated DimensionHeader dimension_headers = 1;
452
-
453
- // Describes metric columns. The number of MetricHeaders and ordering of
454
- // MetricHeaders matches the metrics present in rows.
455
- repeated MetricHeader metric_headers = 2;
456
-
457
- // Rows of dimension value combinations and metric values in the report.
458
- repeated Row rows = 3;
459
-
460
- // If requested, the totaled values of metrics.
461
- repeated Row totals = 4;
462
-
463
- // If requested, the maximum values of metrics.
464
- repeated Row maximums = 5;
465
-
466
- // If requested, the minimum values of metrics.
467
- repeated Row minimums = 6;
468
-
469
- // The total number of rows in the query result, regardless of the number of
470
- // rows returned in the response. For example if a query returns 175 rows and
471
- // includes limit = 50 in the API request, the response will contain row_count
472
- // = 175 but only 50 rows.
473
- int32 row_count = 7;
162
+ // This Analytics Property's quota state including this request.
163
+ PropertyQuota property_quota = 3;
474
164
 
475
- // This Analytics Property's Realtime quota state including this request.
476
- PropertyQuota property_quota = 8;
165
+ // Identifies what kind of resource this message is. This `kind` is always the
166
+ // fixed string "analyticsData#runFunnelReport". Useful to distinguish between
167
+ // response types in JSON.
168
+ string kind = 4;
477
169
  }