data.proto 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. // Copyright 2020 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. option go_package = "google.golang.org/genproto/googleapis/analytics/data/v1alpha;data";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ReportingApiProto";
  19. option java_package = "com.google.analytics.data.v1alpha";
  20. // A contiguous set of days: startDate, startDate + 1, ..., endDate. Requests
  21. // are allowed up to 4 date ranges.
  22. message DateRange {
  23. // The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot
  24. // be after `end_date`. The format `NdaysAgo`, `yesterday`, or `today` is also
  25. // accepted, and in that case, the date is inferred based on the property's
  26. // reporting time zone.
  27. string start_date = 1;
  28. // The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot
  29. // be before `start_date`. The format `NdaysAgo`, `yesterday`, or `today` is
  30. // also accepted, and in that case, the date is inferred based on the
  31. // property's reporting time zone.
  32. string end_date = 2;
  33. // Assigns a name to this date range. The dimension `dateRange` is valued to
  34. // this name in a report response. If set, cannot begin with `date_range_` or
  35. // `RESERVED_`. If not set, date ranges are named by their zero based index in
  36. // the request: `date_range_0`, `date_range_1`, etc.
  37. string name = 3;
  38. }
  39. // The unique identifier of the property whose events are tracked.
  40. message Entity {
  41. // A Google Analytics GA4 property id. To learn more, see [where to find your
  42. // Property
  43. // ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
  44. string property_id = 1;
  45. }
  46. // Dimensions are attributes of your data. For example, the dimension city
  47. // indicates the city from which an event originates. Dimension values in report
  48. // responses are strings; for example, city could be "Paris" or "New York".
  49. // Requests are allowed up to 8 dimensions.
  50. message Dimension {
  51. // The name of the dimension. See the [API
  52. // Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions)
  53. // for the list of dimension names.
  54. //
  55. // If `dimensionExpression` is specified, `name` can be any string that you
  56. // would like. For example if a `dimensionExpression` concatenates `country`
  57. // and `city`, you could call that dimension `countryAndCity`.
  58. //
  59. // Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`,
  60. // `dimensionExpression`, and `pivots`.
  61. string name = 1;
  62. // One dimension can be the result of an expression of multiple dimensions.
  63. // For example, dimension "country, city": concatenate(country, ", ", city).
  64. DimensionExpression dimension_expression = 2;
  65. }
  66. // Used to express a dimension which is the result of a formula of multiple
  67. // dimensions. Example usages:
  68. // 1) lower_case(dimension)
  69. // 2) concatenate(dimension1, symbol, dimension2).
  70. message DimensionExpression {
  71. // Used to convert a dimension value to a single case.
  72. message CaseExpression {
  73. // Name of a dimension. The name must refer back to a name in dimensions
  74. // field of the request.
  75. string dimension_name = 1;
  76. }
  77. // Used to combine dimension values to a single dimension.
  78. message ConcatenateExpression {
  79. // Names of dimensions. The names must refer back to names in the dimensions
  80. // field of the request.
  81. repeated string dimension_names = 1;
  82. // The delimiter placed between dimension names.
  83. //
  84. // Delimiters are often single characters such as "|" or "," but can be
  85. // longer strings. If a dimension value contains the delimiter, both will be
  86. // present in response with no distinction. For example if dimension 1 value
  87. // = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the
  88. // response will contain "US,FR,JP".
  89. string delimiter = 2;
  90. }
  91. // Specify one type of dimension expression for `DimensionExpression`.
  92. oneof one_expression {
  93. // Used to convert a dimension value to lower case.
  94. CaseExpression lower_case = 4;
  95. // Used to convert a dimension value to upper case.
  96. CaseExpression upper_case = 5;
  97. // Used to combine dimension values to a single dimension.
  98. // For example, dimension "country, city": concatenate(country, ", ", city).
  99. ConcatenateExpression concatenate = 6;
  100. }
  101. }
  102. // The quantitative measurements of a report. For example, the metric
  103. // `eventCount` is the total number of events. Requests are allowed up to 10
  104. // metrics.
  105. message Metric {
  106. // The name of the metric. See the [API
  107. // Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
  108. // for the list of metric names.
  109. //
  110. // If `expression` is specified, `name` can be any string that you would like.
  111. // For example if `expression` is `screenPageViews/sessions`, you could call
  112. // that metric's name = `viewsPerSession`.
  113. //
  114. // Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
  115. // `expression`.
  116. string name = 1;
  117. // A mathematical expression for derived metrics. For example, the metric
  118. // Event count per user is `eventCount/totalUsers`.
  119. string expression = 2;
  120. // Indicates if a metric is invisible in the report response. If a metric is
  121. // invisible, the metric will not produce a column in the response, but can be
  122. // used in `metricFilter`, `orderBys`, or a metric `expression`.
  123. bool invisible = 3;
  124. }
  125. // To express dimension or metric filters.
  126. // The fields in the same FilterExpression need to be either all dimensions or
  127. // all metrics.
  128. message FilterExpression {
  129. // Specify one type of filter expression for `FilterExpression`.
  130. oneof expr {
  131. // The FilterExpressions in and_group have an AND relationship.
  132. FilterExpressionList and_group = 1;
  133. // The FilterExpressions in or_group have an OR relationship.
  134. FilterExpressionList or_group = 2;
  135. // The FilterExpression is NOT of not_expression.
  136. FilterExpression not_expression = 3;
  137. // A primitive filter.
  138. // All fields in filter in same FilterExpression needs to be either all
  139. // dimensions or metrics.
  140. Filter filter = 4;
  141. }
  142. }
  143. // A list of filter expressions.
  144. message FilterExpressionList {
  145. // A list of filter expressions.
  146. repeated FilterExpression expressions = 1;
  147. }
  148. // An expression to filter dimension or metric values.
  149. message Filter {
  150. // The filter for string
  151. message StringFilter {
  152. // The match type of a string filter
  153. enum MatchType {
  154. // Unspecified
  155. MATCH_TYPE_UNSPECIFIED = 0;
  156. // Exact match of the string value.
  157. EXACT = 1;
  158. // Begins with the string value.
  159. BEGINS_WITH = 2;
  160. // Ends with the string value.
  161. ENDS_WITH = 3;
  162. // Contains the string value.
  163. CONTAINS = 4;
  164. // Full regular expression match with the string value.
  165. FULL_REGEXP = 5;
  166. // Partial regular expression match with the string value.
  167. PARTIAL_REGEXP = 6;
  168. }
  169. // The match type for this filter.
  170. MatchType match_type = 1;
  171. // The string value used for the matching.
  172. string value = 2;
  173. // If true, the string value is case sensitive.
  174. bool case_sensitive = 3;
  175. }
  176. // The result needs to be in a list of string values.
  177. message InListFilter {
  178. // The list of string values.
  179. // Must be non-empty.
  180. repeated string values = 1;
  181. // If true, the string value is case sensitive.
  182. bool case_sensitive = 2;
  183. }
  184. // Filters for numeric or date values.
  185. message NumericFilter {
  186. // The operation applied to a numeric filter
  187. enum Operation {
  188. // Unspecified.
  189. OPERATION_UNSPECIFIED = 0;
  190. // Equal
  191. EQUAL = 1;
  192. // Less than
  193. LESS_THAN = 2;
  194. // Less than or equal
  195. LESS_THAN_OR_EQUAL = 3;
  196. // Greater than
  197. GREATER_THAN = 4;
  198. // Greater than or equal
  199. GREATER_THAN_OR_EQUAL = 5;
  200. }
  201. // The operation type for this filter.
  202. Operation operation = 1;
  203. // A numeric value or a date value.
  204. NumericValue value = 2;
  205. }
  206. // To express that the result needs to be between two numbers (inclusive).
  207. message BetweenFilter {
  208. // Begins with this number.
  209. NumericValue from_value = 1;
  210. // Ends with this number.
  211. NumericValue to_value = 2;
  212. }
  213. // The dimension name or metric name. Must be a name defined in dimensions
  214. // or metrics.
  215. string field_name = 1;
  216. // Specify one type of filter for `Filter`.
  217. oneof one_filter {
  218. // A filter for null values. If True, a null dimension value is matched by
  219. // this filter. Null filter is commonly used inside a NOT filter
  220. // expression. For example, a NOT expression of a null filter removes rows
  221. // when a dimension is null.
  222. bool null_filter = 2;
  223. // Strings related filter.
  224. StringFilter string_filter = 3;
  225. // A filter for in list values.
  226. InListFilter in_list_filter = 4;
  227. // A filter for numeric or date values.
  228. NumericFilter numeric_filter = 5;
  229. // A filter for two values.
  230. BetweenFilter between_filter = 6;
  231. }
  232. }
  233. // The sort options.
  234. message OrderBy {
  235. // Sorts by metric values.
  236. message MetricOrderBy {
  237. // A metric name in the request to order by.
  238. string metric_name = 1;
  239. }
  240. // Sorts by dimension values.
  241. message DimensionOrderBy {
  242. // Rule to order the string dimension values by.
  243. enum OrderType {
  244. // Unspecified.
  245. ORDER_TYPE_UNSPECIFIED = 0;
  246. // Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" <
  247. // "b" < "z".
  248. ALPHANUMERIC = 1;
  249. // Case insensitive alphanumeric sort by lower case Unicode code point.
  250. // For example, "2" < "A" < "b" < "X" < "z".
  251. CASE_INSENSITIVE_ALPHANUMERIC = 2;
  252. // Dimension values are converted to numbers before sorting. For example
  253. // in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" <
  254. // "25". Non-numeric dimension values all have equal ordering value below
  255. // all numeric values.
  256. NUMERIC = 3;
  257. }
  258. // A dimension name in the request to order by.
  259. string dimension_name = 1;
  260. // Controls the rule for dimension value ordering.
  261. OrderType order_type = 2;
  262. }
  263. // Sorts by a pivot column group.
  264. message PivotOrderBy {
  265. // A pair of dimension names and values. Rows with this dimension pivot pair
  266. // are ordered by the metric's value.
  267. //
  268. // For example if pivots = {{"browser", "Chrome"}} and
  269. // metric_name = "Sessions",
  270. // then the rows will be sorted based on Sessions in Chrome.
  271. //
  272. // ---------|----------|----------------|----------|----------------
  273. // | Chrome | Chrome | Safari | Safari
  274. // ---------|----------|----------------|----------|----------------
  275. // Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions
  276. // ---------|----------|----------------|----------|----------------
  277. // US | 2 | 2 | 3 | 1
  278. // ---------|----------|----------------|----------|----------------
  279. // Canada | 3 | 1 | 4 | 1
  280. // ---------|----------|----------------|----------|----------------
  281. message PivotSelection {
  282. // Must be a dimension name from the request.
  283. string dimension_name = 1;
  284. // Order by only when the named dimension is this value.
  285. string dimension_value = 2;
  286. }
  287. // In the response to order by, order rows by this column. Must be a metric
  288. // name from the request.
  289. string metric_name = 1;
  290. // Used to select a dimension name and value pivot. If multiple pivot
  291. // selections are given, the sort occurs on rows where all pivot selection
  292. // dimension name and value pairs match the row's dimension name and value
  293. // pair.
  294. repeated PivotSelection pivot_selections = 2;
  295. }
  296. // Specify one type of order by for `OrderBy`.
  297. oneof one_order_by {
  298. // Sorts results by a metric's values.
  299. MetricOrderBy metric = 1;
  300. // Sorts results by a dimension's values.
  301. DimensionOrderBy dimension = 2;
  302. // Sorts results by a metric's values within a pivot column group.
  303. PivotOrderBy pivot = 3;
  304. }
  305. // If true, sorts by descending order.
  306. bool desc = 4;
  307. }
  308. // Describes the visible dimension columns and rows in the report response.
  309. message Pivot {
  310. // Dimension names for visible columns in the report response. Including
  311. // "dateRange" produces a date range column; for each row in the response,
  312. // dimension values in the date range column will indicate the corresponding
  313. // date range from the request.
  314. repeated string field_names = 1;
  315. // Specifies how dimensions are ordered in the pivot. In the first Pivot, the
  316. // OrderBys determine Row and PivotDimensionHeader ordering; in subsequent
  317. // Pivots, the OrderBys determine only PivotDimensionHeader ordering.
  318. // Dimensions specified in these OrderBys must be a subset of
  319. // Pivot.field_names.
  320. repeated OrderBy order_bys = 2;
  321. // The row count of the start row. The first row is counted as row 0.
  322. int64 offset = 3;
  323. // The number of rows to return in this pivot. If unspecified, 10 rows are
  324. // returned. If -1, all rows are returned.
  325. int64 limit = 4;
  326. // Aggregate the metrics by dimensions in this pivot using the specified
  327. // metric_aggregations.
  328. repeated MetricAggregation metric_aggregations = 5;
  329. }
  330. // Specification of cohorts for a cohort report.
  331. // Cohort reports can be used for example to create a time series of user
  332. // retention for the cohort. For example, you could select the cohort of users
  333. // that were acquired in the first week of September and follow that cohort for
  334. // the next six weeks. Selecting the users acquired in the first week of
  335. // September cohort is specified in the `cohort` object. Following that
  336. // cohort for the next six weeks is specified in the `cohortsRange` object.
  337. //
  338. // The report response could show a weekly time series where say your app has
  339. // retained 60% of this cohort after three weeks and 25% of this cohort after
  340. // six weeks. These two percentages can be calculated by the metric
  341. // `cohortActiveUsers/cohortTotalUsers` and will be separate rows in the report.
  342. message CohortSpec {
  343. // Defines the selection criteria to group users into cohorts.
  344. //
  345. // Most cohort reports define only a single cohort. If multiple cohorts are
  346. // specified, each cohort can be recognized in the report by their name.
  347. repeated Cohort cohorts = 1;
  348. // Cohort reports follow cohorts over an extended reporting date range. This
  349. // range specifies an offset duration to follow the cohorts over.
  350. CohortsRange cohorts_range = 2;
  351. // Optional settings for a cohort report.
  352. CohortReportSettings cohort_report_settings = 3;
  353. }
  354. // Defines a cohort selection criteria. A cohort is a group of users who share
  355. // a common characteristic. For example, users with the same `firstTouchDate`
  356. // belong to the same cohort.
  357. message Cohort {
  358. // Assigns a name to this cohort. The dimension `cohort` is valued to this
  359. // name in a report response. If set, cannot begin with `cohort_` or
  360. // `RESERVED_`. If not set, cohorts are named by their zero based index
  361. // `cohort_0`, `cohort_1`, etc.
  362. string name = 1;
  363. // Dimension used by the cohort. Required and only supports `firstTouchDate`.
  364. string dimension = 2;
  365. // The cohort selects users whose first touch date is between start date and
  366. // end date defined in the `dateRange`. This `dateRange` does not specify the
  367. // full date range of event data that is present in a cohort report. In a
  368. // cohort report, this `dateRange` is extended by the granularity and offset
  369. // present in the `cohortsRange`; event data for the extended reporting date
  370. // range is present in a cohort report.
  371. //
  372. // In a cohort request, this `dateRange` is required and the `dateRanges` in
  373. // the `RunReportRequest` or `RunPivotReportRequest` must be unspecified.
  374. //
  375. // This `dateRange` should generally be aligned with the cohort's granularity.
  376. // If `CohortsRange` uses daily granularity, this `dateRange` can be a single
  377. // day. If `CohortsRange` uses weekly granularity, this `dateRange` can be
  378. // aligned to a week boundary, starting at Sunday and ending Saturday. If
  379. // `CohortsRange` uses monthly granularity, this `dateRange` can be aligned to
  380. // a month, starting at the first and ending on the last day of the month.
  381. DateRange date_range = 3;
  382. }
  383. // Configures the extended reporting date range for a cohort report. Specifies
  384. // an offset duration to follow the cohorts over.
  385. message CohortsRange {
  386. // The granularity used to interpret the `startOffset` and `endOffset` for the
  387. // extended reporting date range for a cohort report.
  388. enum Granularity {
  389. // Should never be specified.
  390. GRANULARITY_UNSPECIFIED = 0;
  391. // Daily granularity. Commonly used if the cohort's `dateRange` is a single
  392. // day and the request contains `cohortNthDay`.
  393. DAILY = 1;
  394. // Weekly granularity. Commonly used if the cohort's `dateRange` is a week
  395. // in duration (starting on Sunday and ending on Saturday) and the request
  396. // contains `cohortNthWeek`.
  397. WEEKLY = 2;
  398. // Monthly granularity. Commonly used if the cohort's `dateRange` is a month
  399. // in duration and the request contains `cohortNthMonth`.
  400. MONTHLY = 3;
  401. }
  402. // The granularity used to interpret the `startOffset` and `endOffset` for the
  403. // extended reporting date range for a cohort report.
  404. Granularity granularity = 1;
  405. // `startOffset` specifies the start date of the extended reporting date range
  406. // for a cohort report. `startOffset` is commonly set to 0 so that reports
  407. // contain data from the acquisition of the cohort forward.
  408. //
  409. // If `granularity` is `DAILY`, the `startDate` of the extended reporting date
  410. // range is `startDate` of the cohort plus `startOffset` days.
  411. //
  412. // If `granularity` is `WEEKLY`, the `startDate` of the extended reporting
  413. // date range is `startDate` of the cohort plus `startOffset * 7` days.
  414. //
  415. // If `granularity` is `MONTHLY`, the `startDate` of the extended reporting
  416. // date range is `startDate` of the cohort plus `startOffset * 30` days.
  417. int32 start_offset = 2;
  418. // `endOffset` specifies the end date of the extended reporting date range
  419. // for a cohort report. `endOffset` can be any positive integer but is
  420. // commonly set to 5 to 10 so that reports contain data on the cohort for the
  421. // next several granularity time periods.
  422. //
  423. // If `granularity` is `DAILY`, the `endDate` of the extended reporting date
  424. // range is `endDate` of the cohort plus `endOffset` days.
  425. //
  426. // If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date
  427. // range is `endDate` of the cohort plus `endOffset * 7` days.
  428. //
  429. // If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date
  430. // range is `endDate` of the cohort plus `endOffset * 30` days.
  431. int32 end_offset = 3;
  432. }
  433. // Optional settings of a cohort report.
  434. message CohortReportSettings {
  435. // If true, accumulates the result from first touch day to the end day. Not
  436. // supported in `RunReportRequest`.
  437. bool accumulate = 1;
  438. }
  439. // Response's metadata carrying additional information about the report content.
  440. message ResponseMetaData {
  441. // If true, indicates some buckets of dimension combinations are rolled into
  442. // "(other)" row. This can happen for high cardinality reports.
  443. bool data_loss_from_other_row = 3;
  444. }
  445. // Describes a dimension column in the report. Dimensions requested in a report
  446. // produce column entries within rows and DimensionHeaders. However, dimensions
  447. // used exclusively within filters or expressions do not produce columns in a
  448. // report; correspondingly, those dimensions do not produce headers.
  449. message DimensionHeader {
  450. // The dimension's name.
  451. string name = 1;
  452. }
  453. // Describes a metric column in the report. Visible metrics requested in a
  454. // report produce column entries within rows and MetricHeaders. However,
  455. // metrics used exclusively within filters or expressions do not produce columns
  456. // in a report; correspondingly, those metrics do not produce headers.
  457. message MetricHeader {
  458. // The metric's name.
  459. string name = 1;
  460. // The metric's data type.
  461. MetricType type = 2;
  462. }
  463. // Dimensions' values in a single pivot.
  464. message PivotHeader {
  465. // The size is the same as the cardinality of the corresponding dimension
  466. // combinations.
  467. repeated PivotDimensionHeader pivot_dimension_headers = 1;
  468. // The cardinality of the pivot as if offset = 0 and limit = -1. The total
  469. // number of rows for this pivot's fields regardless of how the parameters
  470. // offset and limit are specified in the request.
  471. int32 row_count = 2;
  472. }
  473. // Summarizes dimension values from a row for this pivot.
  474. message PivotDimensionHeader {
  475. // Values of multiple dimensions in a pivot.
  476. repeated DimensionValue dimension_values = 1;
  477. }
  478. // Report data for each row.
  479. // For example if RunReportRequest contains:
  480. //
  481. // ```none
  482. // "dimensions": [
  483. // {
  484. // "name": "eventName"
  485. // },
  486. // {
  487. // "name": "countryId"
  488. // }
  489. // ],
  490. // "metrics": [
  491. // {
  492. // "name": "eventCount"
  493. // }
  494. // ]
  495. // ```
  496. //
  497. // One row with 'in_app_purchase' as the eventName, 'JP' as the countryId, and
  498. // 15 as the eventCount, would be:
  499. //
  500. // ```none
  501. // "dimensionValues": [
  502. // {
  503. // "value": "in_app_purchase"
  504. // },
  505. // {
  506. // "value": "JP"
  507. // }
  508. // ],
  509. // "metricValues": [
  510. // {
  511. // "value": "15"
  512. // }
  513. // ]
  514. // ```
  515. message Row {
  516. // List of requested dimension values. In a PivotReport, dimension_values
  517. // are only listed for dimensions included in a pivot.
  518. repeated DimensionValue dimension_values = 1;
  519. // List of requested visible metric values.
  520. repeated MetricValue metric_values = 2;
  521. }
  522. // The value of a dimension.
  523. message DimensionValue {
  524. // One kind of dimension value
  525. oneof one_value {
  526. // Value as a string if the dimension type is a string.
  527. string value = 1;
  528. }
  529. }
  530. // The value of a metric.
  531. message MetricValue {
  532. // One of metric value
  533. oneof one_value {
  534. // Measurement value. See MetricHeader for type.
  535. string value = 4;
  536. }
  537. }
  538. // To represent a number.
  539. message NumericValue {
  540. // One of a numeric value
  541. oneof one_value {
  542. // Integer value
  543. int64 int64_value = 1;
  544. // Double value
  545. double double_value = 2;
  546. }
  547. }
  548. // Current state of all quotas for this Analytics Property. If any quota for a
  549. // property is exhausted, all requests to that property will return Resource
  550. // Exhausted errors.
  551. message PropertyQuota {
  552. // Standard Analytics Properties can use up to 25,000 tokens per day;
  553. // Analytics 360 Properties can use 250,000 tokens per day. Most requests
  554. // consume fewer than 10 tokens.
  555. QuotaStatus tokens_per_day = 1;
  556. // Standard Analytics Properties can use up to 5,000 tokens per day; Analytics
  557. // 360 Properties can use 50,000 tokens per day. An API request consumes a
  558. // single number of tokens, and that number is deducted from both the hourly
  559. // and daily quotas.
  560. QuotaStatus tokens_per_hour = 2;
  561. // Standard Analytics Properties can send up to 10 concurrent requests;
  562. // Analytics 360 Properties can use up to 50 concurrent requests.
  563. QuotaStatus concurrent_requests = 3;
  564. // Standard Analytics Properties and cloud project pairs can have up to 10
  565. // server errors per hour; Analytics 360 Properties and cloud project pairs
  566. // can have up to 50 server errors per hour.
  567. QuotaStatus server_errors_per_project_per_hour = 4;
  568. }
  569. // Current state for a particular quota group.
  570. message QuotaStatus {
  571. // Quota consumed by this request.
  572. int32 consumed = 1;
  573. // Quota remaining after this request.
  574. int32 remaining = 2;
  575. }
  576. // Explains a dimension.
  577. message DimensionMetadata {
  578. // This dimension's name. Useable in [Dimension](#Dimension)'s `name`. For
  579. // example, `eventName`.
  580. string api_name = 1;
  581. // This dimension's name within the Google Analytics user interface. For
  582. // example, `Event name`.
  583. string ui_name = 2;
  584. // Description of how this dimension is used and calculated.
  585. string description = 3;
  586. // Still usable but deprecated names for this dimension. If populated, this
  587. // dimension is available by either `apiName` or one of `deprecatedApiNames`
  588. // for a period of time. After the deprecation period, the dimension will be
  589. // available only by `apiName`.
  590. repeated string deprecated_api_names = 4;
  591. // True if the dimension is a custom dimension for this property.
  592. bool custom_definition = 5;
  593. }
  594. // Explains a metric.
  595. message MetricMetadata {
  596. // A metric name. Useable in [Metric](#Metric)'s `name`. For example,
  597. // `eventCount`.
  598. string api_name = 1;
  599. // This metric's name within the Google Analytics user interface. For example,
  600. // `Event count`.
  601. string ui_name = 2;
  602. // Description of how this metric is used and calculated.
  603. string description = 3;
  604. // Still usable but deprecated names for this metric. If populated, this
  605. // metric is available by either `apiName` or one of `deprecatedApiNames`
  606. // for a period of time. After the deprecation period, the metric will be
  607. // available only by `apiName`.
  608. repeated string deprecated_api_names = 4;
  609. // The type of this metric.
  610. MetricType type = 5;
  611. // The mathematical expression for this derived metric. Can be used in
  612. // [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics
  613. // are not expressions, and for non-expressions, this field is empty.
  614. string expression = 6;
  615. // True if the metric is a custom metric for this property.
  616. bool custom_definition = 7;
  617. }
  618. // Represents aggregation of metrics.
  619. enum MetricAggregation {
  620. // Unspecified operator.
  621. METRIC_AGGREGATION_UNSPECIFIED = 0;
  622. // SUM operator.
  623. TOTAL = 1;
  624. // Minimum operator.
  625. MINIMUM = 5;
  626. // Maximum operator.
  627. MAXIMUM = 6;
  628. // Count operator.
  629. COUNT = 4;
  630. }
  631. // A metric's value type.
  632. enum MetricType {
  633. // Unspecified type.
  634. METRIC_TYPE_UNSPECIFIED = 0;
  635. // Integer type.
  636. TYPE_INTEGER = 1;
  637. // Floating point type.
  638. TYPE_FLOAT = 2;
  639. // A duration of seconds; a special floating point type.
  640. TYPE_SECONDS = 4;
  641. // A duration in milliseconds; a special floating point type.
  642. TYPE_MILLISECONDS = 5;
  643. // A duration in minutes; a special floating point type.
  644. TYPE_MINUTES = 6;
  645. // A duration in hours; a special floating point type.
  646. TYPE_HOURS = 7;
  647. // A custom metric of standard type; a special floating point type.
  648. TYPE_STANDARD = 8;
  649. // An amount of money; a special floating point type.
  650. TYPE_CURRENCY = 9;
  651. // A length in feet; a special floating point type.
  652. TYPE_FEET = 10;
  653. // A length in miles; a special floating point type.
  654. TYPE_MILES = 11;
  655. // A length in meters; a special floating point type.
  656. TYPE_METERS = 12;
  657. // A length in kilometers; a special floating point type.
  658. TYPE_KILOMETERS = 13;
  659. }