data.proto 29 KB

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