analytics_data_api.proto 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.analytics.data.v1alpha;
  16. import "google/analytics/data/v1alpha/data.proto";
  17. import "google/api/annotations.proto";
  18. import "google/api/client.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "AnalyticsDataApiProto";
  22. option java_package = "com.google.analytics.data.v1alpha";
  23. // Google Analytics reporting data service.
  24. service AlphaAnalyticsData {
  25. option (google.api.default_host) = "analyticsdata.googleapis.com";
  26. option (google.api.oauth_scopes) =
  27. "https://www.googleapis.com/auth/analytics,"
  28. "https://www.googleapis.com/auth/analytics.readonly";
  29. // Returns a customized funnel report of your Google Analytics event data. The
  30. // data returned from the API is as a table with columns for the requested
  31. // dimensions and metrics.
  32. //
  33. // Funnel exploration lets you visualize the steps your users take to complete
  34. // a task and quickly see how well they are succeeding or failing at each
  35. // step. For example, how do prospects become shoppers and then become buyers?
  36. // How do one time buyers become repeat buyers? With this information, you can
  37. // improve inefficient or abandoned customer journeys. To learn more, see [GA4
  38. // Funnel Explorations](https://support.google.com/analytics/answer/9327974).
  39. rpc RunFunnelReport(RunFunnelReportRequest) returns (RunFunnelReportResponse) {
  40. option (google.api.http) = {
  41. post: "/v1alpha/{property=properties/*}:runFunnelReport"
  42. body: "*"
  43. };
  44. }
  45. }
  46. // The request for a funnel report.
  47. message RunFunnelReportRequest {
  48. // Controls the dimensions present in the funnel visualization sub report
  49. // response.
  50. enum FunnelVisualizationType {
  51. // Unspecified type.
  52. FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0;
  53. // A standard (stepped) funnel. The funnel visualization sub report in the
  54. // response will not contain date.
  55. STANDARD_FUNNEL = 1;
  56. // A trended (line chart) funnel. The funnel visualization sub report in the
  57. // response will contain the date dimension.
  58. TRENDED_FUNNEL = 2;
  59. }
  60. // A Google Analytics GA4 property identifier whose events are tracked.
  61. // Specified in the URL path and not the body. To learn more, see [where to
  62. // find your Property
  63. // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
  64. // Within a batch request, this property should either be unspecified or
  65. // consistent with the batch-level property.
  66. //
  67. // Example: properties/1234
  68. string property = 1;
  69. // Date ranges of data to read. If multiple date ranges are requested, each
  70. // response row will contain a zero based date range index. If two date
  71. // ranges overlap, the event data for the overlapping days is included in the
  72. // response rows for both date ranges.
  73. repeated DateRange date_ranges = 2;
  74. // The configuration of this request's funnel. This funnel configuration is
  75. // required.
  76. Funnel funnel = 3;
  77. // If specified, this breakdown adds a dimension to the funnel table sub
  78. // report response. This breakdown dimension expands each funnel step to the
  79. // unique values of the breakdown dimension. For example, a breakdown by the
  80. // `deviceCategory` dimension will create rows for `mobile`, `tablet`,
  81. // `desktop`, and the total.
  82. FunnelBreakdown funnel_breakdown = 4;
  83. // If specified, next action adds a dimension to the funnel visualization sub
  84. // report response. This next action dimension expands each funnel step to the
  85. // unique values of the next action. For example a next action of the
  86. // `eventName` dimension will create rows for several events (i.e.
  87. // `session_start` & `click`) and the total.
  88. //
  89. // Next action only supports `eventName` and most Page / Screen dimensions
  90. // like `pageTitle` and `pagePath`.
  91. FunnelNextAction funnel_next_action = 5;
  92. // The funnel visualization type controls the dimensions present in the funnel
  93. // visualization sub report response. If not specified, `STANDARD_FUNNEL` is
  94. // used.
  95. FunnelVisualizationType funnel_visualization_type = 6;
  96. // The configurations of segments. Segments are subsets of a property's data.
  97. // In a funnel report with segments, the funnel is evaluated in each segment.
  98. //
  99. // Each segment specified in this request
  100. // produces a separate row in the response; in the response, each segment
  101. // identified by its name.
  102. //
  103. // The segments parameter is optional. Requests are limited to 4 segments.
  104. repeated Segment segments = 7;
  105. // The number of rows to return. If unspecified, 10,000 rows are returned. The
  106. // API returns a maximum of 100,000 rows per request, no matter how many you
  107. // ask for. `limit` must be positive.
  108. //
  109. // The API can also return fewer rows than the requested `limit`, if there
  110. // aren't as many dimension values as the `limit`.
  111. int64 limit = 9;
  112. // Dimension filters allow you to ask for only specific dimension values in
  113. // the report. To learn more, see [Creating a Report: Dimension
  114. // Filters](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
  115. // for examples. Metrics cannot be used in this filter.
  116. FilterExpression dimension_filter = 10;
  117. // Toggles whether to return the current state of this Analytics Property's
  118. // quota. Quota is returned in [PropertyQuota](#PropertyQuota).
  119. bool return_property_quota = 12;
  120. }
  121. // The funnel report response contains two sub reports. The two sub reports are
  122. // different combinations of dimensions and metrics.
  123. message RunFunnelReportResponse {
  124. // The funnel table is a report with the funnel step, segment, breakdown
  125. // dimension, active users, completion rate, abandonments, and abandonments
  126. // rate.
  127. //
  128. // The segment dimension is only present in this response if a segment was
  129. // requested. The breakdown dimension is only present in this response if it
  130. // was requested.
  131. FunnelSubReport funnel_table = 1;
  132. // The funnel visualization is a report with the funnel step, segment, date,
  133. // next action dimension, and active users.
  134. //
  135. // The segment dimension is only present in this response if a segment was
  136. // requested. The date dimension is only present in this response if it was
  137. // requested via the `TRENDED_FUNNEL` funnel type. The next action dimension
  138. // is only present in the response if it was requested.
  139. FunnelSubReport funnel_visualization = 2;
  140. // This Analytics Property's quota state including this request.
  141. PropertyQuota property_quota = 3;
  142. // Identifies what kind of resource this message is. This `kind` is always the
  143. // fixed string "analyticsData#runFunnelReport". Useful to distinguish between
  144. // response types in JSON.
  145. string kind = 4;
  146. }