@google-analytics/data 5.2.2 → 6.1.0

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 2025 Google LLC
1
+ // Copyright 2026 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.
@@ -156,6 +156,24 @@ message Metric {
156
156
  bool invisible = 3;
157
157
  }
158
158
 
159
+ // Defines an individual comparison. Most requests will include multiple
160
+ // comparisons so that the report compares between the comparisons.
161
+ message Comparison {
162
+ // Each comparison produces separate rows in the response. In the response,
163
+ // this comparison is identified by this name. If name is unspecified, we will
164
+ // use the saved comparisons display name.
165
+ optional string name = 1;
166
+
167
+ oneof one_comparison {
168
+ // A basic comparison.
169
+ FilterExpression dimension_filter = 2;
170
+
171
+ // A saved comparison identified by the comparison's resource name.
172
+ // For example, 'comparisons/1234'.
173
+ string comparison = 3;
174
+ }
175
+ }
176
+
159
177
  // To express dimension or metric filters. The fields in the same
160
178
  // FilterExpression need to be either all dimensions or all metrics.
161
179
  message FilterExpression {
@@ -487,6 +505,25 @@ message CohortReportSettings {
487
505
  bool accumulate = 1;
488
506
  }
489
507
 
508
+ // Identifies if the report data is from the standard report data or
509
+ // conversion data
510
+ enum Section {
511
+ // Should never be specified.
512
+ SECTION_UNSPECIFIED = 0;
513
+
514
+ // The report data is from the standard report data. Google Analytics reports
515
+ // include acquisition, engagement, and user behavior reports. Reports use
516
+ // dimensions like session source & landing page; reports use metrics like
517
+ // sessions, views, and engagement time.
518
+ SECTION_REPORT = 1;
519
+
520
+ // The report data is from the conversion data. The Google Analytics
521
+ // Advertising section reports on conversion performance. Advertising reports
522
+ // use dimensions like source & medium; advertising reports use metrics like
523
+ // all conversions and ads cost.
524
+ SECTION_ADVERTISING = 2;
525
+ }
526
+
490
527
  // Response's metadata carrying additional information about the report content.
491
528
  message ResponseMetaData {
492
529
  // The schema restrictions actively enforced in creating this report. To learn
@@ -561,15 +598,18 @@ message ResponseMetaData {
561
598
  // Interests](https://support.google.com/analytics/answer/2799357).
562
599
  optional bool subject_to_thresholding = 8;
563
600
 
564
- // If this report's results are
601
+ // If this report results is
565
602
  // [sampled](https://support.google.com/analytics/answer/13331292), this
566
603
  // describes the percentage of events used in this report. One
567
604
  // `samplingMetadatas` is populated for each date range. Each
568
- // `samplingMetadatas` corresponds to a date range in the order that date
569
- // ranges were specified in the request.
605
+ // `samplingMetadatas` corresponds to a date range in order that date ranges
606
+ // were specified in the request.
570
607
  //
571
608
  // However if the results are not sampled, this field will not be defined.
572
609
  repeated SamplingMetadata sampling_metadatas = 9;
610
+
611
+ // Identifies the type of data in the report.
612
+ Section section = 10;
573
613
  }
574
614
 
575
615
  // Describes a dimension column in the report. Dimensions requested in a report
@@ -1488,8 +1528,8 @@ message FunnelResponseMetadata {
1488
1528
  // [sampled](https://support.google.com/analytics/answer/13331292), this
1489
1529
  // describes what percentage of events were used in this funnel report. One
1490
1530
  // `samplingMetadatas` is populated for each date range. Each
1491
- // `samplingMetadatas` corresponds to a date range in the order that date
1492
- // ranges were specified in the request.
1531
+ // `samplingMetadatas` corresponds to a date range in order that date ranges
1532
+ // were specified in the request.
1493
1533
  //
1494
1534
  // However if the results are not sampled, this field will not be defined.
1495
1535
  repeated SamplingMetadata sampling_metadatas = 1;
@@ -1609,3 +1649,166 @@ enum SamplingLevel {
1609
1649
  // https://support.google.com/analytics/answer/10896953.
1610
1650
  UNSAMPLED = 3;
1611
1651
  }
1652
+
1653
+ // Controls conversion reporting.
1654
+ //
1655
+ // <aside class="caution">
1656
+ // This feature may not be available to your Google Analytics property. The
1657
+ // Google Analytics team is actively working to expand this feature to more
1658
+ // properties. Please reach out to your
1659
+ // <a href="https://support.google.com/analytics/gethelp">support team</a> if
1660
+ // you have questions about the eligibility of your property.
1661
+ // </aside>
1662
+ message ConversionSpec {
1663
+ // Attribution model to use in the Conversion Report
1664
+ enum AttributionModel {
1665
+ // Unspecified attribution model.
1666
+ ATTRIBUTION_MODEL_UNSPECIFIED = 0;
1667
+
1668
+ // Attribution was based on the paid and organic data driven model
1669
+ DATA_DRIVEN = 1;
1670
+
1671
+ // Attribution was based on the paid and organic last click model
1672
+ LAST_CLICK = 2;
1673
+ }
1674
+
1675
+ // The conversion action IDs to include in the report. If empty, all
1676
+ // conversions are included. Valid conversion action IDs can be retrieved from
1677
+ // the `conversion_action` field within the `conversions` list in the
1678
+ // response of the `GetMetadata` method. For example,
1679
+ // 'conversionActions/1234'.
1680
+ repeated string conversion_actions = 1;
1681
+
1682
+ // The attribution model to use in the Conversion Report. If unspecified,
1683
+ // `DATA_DRIVEN` is used.
1684
+ AttributionModel attribution_model = 2;
1685
+ }
1686
+
1687
+ // Explains a dimension.
1688
+ message DimensionMetadata {
1689
+ // This dimension's name. Usable in [Dimension](#Dimension)'s `name`. For
1690
+ // example, `eventName`.
1691
+ string api_name = 1;
1692
+
1693
+ // This dimension's name within the Google Analytics user interface. For
1694
+ // example, `Event name`.
1695
+ string ui_name = 2;
1696
+
1697
+ // Description of how this dimension is used and calculated.
1698
+ string description = 3;
1699
+
1700
+ // Still usable but deprecated names for this dimension. If populated, this
1701
+ // dimension is available by either `apiName` or one of `deprecatedApiNames`
1702
+ // for a period of time. After the deprecation period, the dimension will be
1703
+ // available only by `apiName`.
1704
+ repeated string deprecated_api_names = 4;
1705
+
1706
+ // True if the dimension is custom to this property. This includes user,
1707
+ // event, & item scoped custom dimensions; to learn more about custom
1708
+ // dimensions, see https://support.google.com/analytics/answer/14240153. This
1709
+ // also include custom channel groups; to learn more about custom channel
1710
+ // groups, see https://support.google.com/analytics/answer/13051316.
1711
+ bool custom_definition = 5;
1712
+
1713
+ // The display name of the category that this dimension belongs to. Similar
1714
+ // dimensions and metrics are categorized together.
1715
+ string category = 6;
1716
+
1717
+ // Specifies the Google Analytics sections this dimension applies to.
1718
+ repeated Section sections = 7;
1719
+ }
1720
+
1721
+ // Explains a metric.
1722
+ message MetricMetadata {
1723
+ // Justifications for why this metric is blocked.
1724
+ enum BlockedReason {
1725
+ // Will never be specified in API response.
1726
+ BLOCKED_REASON_UNSPECIFIED = 0;
1727
+
1728
+ // If present, your access is blocked to revenue related metrics for this
1729
+ // property, and this metric is revenue related.
1730
+ NO_REVENUE_METRICS = 1;
1731
+
1732
+ // If present, your access is blocked to cost related metrics for this
1733
+ // property, and this metric is cost related.
1734
+ NO_COST_METRICS = 2;
1735
+ }
1736
+
1737
+ // A metric name. Usable in [Metric](#Metric)'s `name`. For example,
1738
+ // `eventCount`.
1739
+ string api_name = 1;
1740
+
1741
+ // This metric's name within the Google Analytics user interface. For example,
1742
+ // `Event count`.
1743
+ string ui_name = 2;
1744
+
1745
+ // Description of how this metric is used and calculated.
1746
+ string description = 3;
1747
+
1748
+ // Still usable but deprecated names for this metric. If populated, this
1749
+ // metric is available by either `apiName` or one of `deprecatedApiNames`
1750
+ // for a period of time. After the deprecation period, the metric will be
1751
+ // available only by `apiName`.
1752
+ repeated string deprecated_api_names = 4;
1753
+
1754
+ // The type of this metric.
1755
+ MetricType type = 5;
1756
+
1757
+ // The mathematical expression for this derived metric. Can be used in
1758
+ // [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics
1759
+ // are not expressions, and for non-expressions, this field is empty.
1760
+ string expression = 6;
1761
+
1762
+ // True if the metric is a custom metric for this property.
1763
+ bool custom_definition = 7;
1764
+
1765
+ // If reasons are specified, your access is blocked to this metric for this
1766
+ // property. API requests from you to this property for this metric will
1767
+ // succeed; however, the report will contain only zeros for this metric. API
1768
+ // requests with metric filters on blocked metrics will fail. If reasons are
1769
+ // empty, you have access to this metric.
1770
+ //
1771
+ // To learn more, see [Access and data-restriction
1772
+ // management](https://support.google.com/analytics/answer/10851388).
1773
+ repeated BlockedReason blocked_reasons = 8;
1774
+
1775
+ // The display name of the category that this metrics belongs to. Similar
1776
+ // dimensions and metrics are categorized together.
1777
+ string category = 9;
1778
+
1779
+ // Specifies the Google Analytics sections this metric applies to.
1780
+ repeated Section sections = 10;
1781
+ }
1782
+
1783
+ // The metadata for a single comparison.
1784
+ message ComparisonMetadata {
1785
+ // This comparison's resource name. Usable in [Comparison](#Comparison)'s
1786
+ // `comparison` field. For example, 'comparisons/1234'.
1787
+ string api_name = 1;
1788
+
1789
+ // This comparison's name within the Google Analytics user interface.
1790
+ string ui_name = 2;
1791
+
1792
+ // This comparison's description.
1793
+ string description = 3;
1794
+ }
1795
+
1796
+ // The metadata for a single conversion.
1797
+ //
1798
+ // <aside class="caution">
1799
+ // This feature may not be available to your Google Analytics property. The
1800
+ // Google Analytics team is actively working to expand this feature to more
1801
+ // properties. Please reach out to your
1802
+ // <a href="https://support.google.com/analytics/gethelp">support team</a> if
1803
+ // you have questions about the eligibility of your property.
1804
+ // </aside>
1805
+ message ConversionMetadata {
1806
+ // The unique identifier of the conversion action. This ID is used to specify
1807
+ // which conversions to include in a report by populating the
1808
+ // `conversion_actions` field in the `ConversionsSpec` of a report request.
1809
+ // For example, 'conversionActions/1234'.
1810
+ string conversion_action = 1;
1811
+
1812
+ // This conversion's name within the Google Analytics user interface.
1813
+ string display_name = 2;
1814
+ }