Types for Google Analytics Data v1beta API¶
- class google.analytics.data_v1beta.types.BatchRunPivotReportsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The batch request containing multiple pivot report requests. .. attribute:: property
A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID. This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property.
Example: properties/1234
- type
str
- requests¶
Individual requests. Each request has a separate pivot report response. Each batch request is allowed up to 5 requests.
- Type
Sequence[google.analytics.data_v1beta.types.RunPivotReportRequest]
- class google.analytics.data_v1beta.types.BatchRunPivotReportsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The batch response containing multiple pivot reports. .. attribute:: pivot_reports
Individual responses. Each response has a separate pivot report request.
- type
Sequence[google.analytics.data_v1beta.types.RunPivotReportResponse]
- class google.analytics.data_v1beta.types.BatchRunReportsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The batch request containing multiple report requests. .. attribute:: property
A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID. This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property.
Example: properties/1234
- type
str
- requests¶
Individual requests. Each request has a separate report response. Each batch request is allowed up to 5 requests.
- Type
Sequence[google.analytics.data_v1beta.types.RunReportRequest]
- class google.analytics.data_v1beta.types.BatchRunReportsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The batch response containing multiple reports. .. attribute:: reports
Individual responses. Each response has a separate report request.
- type
Sequence[google.analytics.data_v1beta.types.RunReportResponse]
- class google.analytics.data_v1beta.types.Cohort(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Defines a cohort selection criteria. A cohort is a group of users who share a common characteristic. For example, users with the same
firstSessionDate
belong to the same cohort.- name¶
Assigns a name to this cohort. The dimension
cohort
is valued to this name in a report response. If set, cannot begin withcohort_
orRESERVED_
. If not set, cohorts are named by their zero based indexcohort_0
,cohort_1
, etc.- Type
- date_range¶
The cohort selects users whose first touch date is between start date and end date defined in the
dateRange
. ThisdateRange
does not specify the full date range of event data that is present in a cohort report. In a cohort report, thisdateRange
is extended by the granularity and offset present in thecohortsRange
; event data for the extended reporting date range is present in a cohort report.In a cohort request, this
dateRange
is required and thedateRanges
in theRunReportRequest
orRunPivotReportRequest
must be unspecified.This
dateRange
should generally be aligned with the cohort’s granularity. IfCohortsRange
uses daily granularity, thisdateRange
can be a single day. IfCohortsRange
uses weekly granularity, thisdateRange
can be aligned to a week boundary, starting at Sunday and ending Saturday. IfCohortsRange
uses monthly granularity, thisdateRange
can be aligned to a month, starting at the first and ending on the last day of the month.
- class google.analytics.data_v1beta.types.CohortReportSettings(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Optional settings of a cohort report. .. attribute:: accumulate
If true, accumulates the result from first touch day to the end day. Not supported in
RunReportRequest
.- type
bool
- class google.analytics.data_v1beta.types.CohortSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The specification of cohorts for a cohort report.
Cohort reports create a time series of user retention for the cohort. For example, you could select the cohort of users that were acquired in the first week of September and follow that cohort for the next six weeks. Selecting the users acquired in the first week of September cohort is specified in the
cohort
object. Following that cohort for the next six weeks is specified in thecohortsRange
object.For examples, see Cohort Report Examples.
The report response could show a weekly time series where say your app has retained 60% of this cohort after three weeks and 25% of this cohort after six weeks. These two percentages can be calculated by the metric
cohortActiveUsers/cohortTotalUsers
and will be separate rows in the report.- cohorts¶
Defines the selection criteria to group users into cohorts. Most cohort reports define only a single cohort. If multiple cohorts are specified, each cohort can be recognized in the report by their name.
- Type
- cohorts_range¶
Cohort reports follow cohorts over an extended reporting date range. This range specifies an offset duration to follow the cohorts over.
- cohort_report_settings¶
Optional settings for a cohort report.
- class google.analytics.data_v1beta.types.CohortsRange(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Configures the extended reporting date range for a cohort report. Specifies an offset duration to follow the cohorts over.
- granularity¶
Required. The granularity used to interpret the
startOffset
andendOffset
for the extended reporting date range for a cohort report.
- start_offset¶
startOffset
specifies the start date of the extended reporting date range for a cohort report.startOffset
is commonly set to 0 so that reports contain data from the acquisition of the cohort forward.If
granularity
isDAILY
, thestartDate
of the extended reporting date range isstartDate
of the cohort plusstartOffset
days.If
granularity
isWEEKLY
, thestartDate
of the extended reporting date range isstartDate
of the cohort plusstartOffset * 7
days.If
granularity
isMONTHLY
, thestartDate
of the extended reporting date range isstartDate
of the cohort plusstartOffset * 30
days.- Type
- end_offset¶
Required.
endOffset
specifies the end date of the extended reporting date range for a cohort report.endOffset
can be any positive integer but is commonly set to 5 to 10 so that reports contain data on the cohort for the next several granularity time periods.If
granularity
isDAILY
, theendDate
of the extended reporting date range isendDate
of the cohort plusendOffset
days.If
granularity
isWEEKLY
, theendDate
of the extended reporting date range isendDate
of the cohort plusendOffset * 7
days.If
granularity
isMONTHLY
, theendDate
of the extended reporting date range isendDate
of the cohort plusendOffset * 30
days.- Type
- class google.analytics.data_v1beta.types.DateRange(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A contiguous set of days: startDate, startDate + 1, …, endDate. Requests are allowed up to 4 date ranges.
- start_date¶
The inclusive start date for the query in the format
YYYY-MM-DD
. Cannot be afterend_date
. The formatNdaysAgo
,yesterday
, ortoday
is also accepted, and in that case, the date is inferred based on the property’s reporting time zone.- Type
- end_date¶
The inclusive end date for the query in the format
YYYY-MM-DD
. Cannot be beforestart_date
. The formatNdaysAgo
,yesterday
, ortoday
is also accepted, and in that case, the date is inferred based on the property’s reporting time zone.- Type
- class google.analytics.data_v1beta.types.Dimension(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Dimensions are attributes of your data. For example, the dimension city indicates the city from which an event originates. Dimension values in report responses are strings; for example, city could be “Paris” or “New York”. Requests are allowed up to 9 dimensions.
- name¶
The name of the dimension. See the API Dimensions for the list of dimension names.
If
dimensionExpression
is specified,name
can be any string that you would like within the allowed character set. For example if adimensionExpression
concatenatescountry
andcity
, you could call that dimensioncountryAndCity
. Dimension names that you choose must match the regular expression^[a-zA-Z0-9_]$
.Dimensions are referenced by
name
indimensionFilter
,orderBys
,dimensionExpression
, andpivots
.- Type
- dimension_expression¶
One dimension can be the result of an expression of multiple dimensions. For example, dimension “country, city”: concatenate(country, “, “, city).
- class google.analytics.data_v1beta.types.DimensionExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Used to express a dimension which is the result of a formula of multiple dimensions. Example usages:
lower_case(dimension)
concatenate(dimension1, symbol, dimension2).
- lower_case¶
Used to convert a dimension value to lower case.
- upper_case¶
Used to convert a dimension value to upper case.
- concatenate¶
Used to combine dimension values to a single dimension. For example, dimension “country, city”: concatenate(country, “, “, city).
- class CaseExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Used to convert a dimension value to a single case. .. attribute:: dimension_name
Name of a dimension. The name must refer back to a name in dimensions field of the request.
- type
str
- class ConcatenateExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Used to combine dimension values to a single dimension. .. attribute:: dimension_names
Names of dimensions. The names must refer back to names in the dimensions field of the request.
- type
Sequence[str]
- delimiter¶
The delimiter placed between dimension names.
Delimiters are often single characters such as “|” or “,” but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = “US,FR”, dimension 2 value = “JP”, and delimiter = “,”, then the response will contain “US,FR,JP”.
- Type
- class google.analytics.data_v1beta.types.DimensionHeader(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Describes a dimension column in the report. Dimensions requested in a report produce column entries within rows and DimensionHeaders. However, dimensions used exclusively within filters or expressions do not produce columns in a report; correspondingly, those dimensions do not produce headers.
- class google.analytics.data_v1beta.types.DimensionMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Explains a dimension. .. attribute:: api_name
This dimension’s name. Useable in Dimension’s
name
. For example,eventName
.- type
str
- ui_name¶
This dimension’s name within the Google Analytics user interface. For example,
Event name
.- Type
- class google.analytics.data_v1beta.types.DimensionValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The value of a dimension. .. attribute:: value
Value as a string if the dimension type is a string.
- type
str
- class google.analytics.data_v1beta.types.Filter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
An expression to filter dimension or metric values. .. attribute:: field_name
The dimension name or metric name. Must be a name defined in dimensions or metrics.
- type
str
- string_filter¶
Strings related filter.
- in_list_filter¶
A filter for in list values.
- numeric_filter¶
A filter for numeric or date values.
- between_filter¶
A filter for two values.
- class BetweenFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
To express that the result needs to be between two numbers (inclusive).
- from_value¶
Begins with this number.
- to_value¶
Ends with this number.
- class InListFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The result needs to be in a list of string values. .. attribute:: values
The list of string values. Must be non-empty.
- type
Sequence[str]
- class NumericFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Filters for numeric or date values. .. attribute:: operation
The operation type for this filter.
- type
google.analytics.data_v1beta.types.Filter.NumericFilter.Operation
- value¶
A numeric value or a date value.
- class StringFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The filter for string .. attribute:: match_type
The match type for this filter.
- type
google.analytics.data_v1beta.types.Filter.StringFilter.MatchType
- class google.analytics.data_v1beta.types.FilterExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
To express dimension or metric filters. The fields in the same FilterExpression need to be either all dimensions or all metrics.
- and_group¶
The FilterExpressions in and_group have an AND relationship.
- or_group¶
The FilterExpressions in or_group have an OR relationship.
- not_expression¶
The FilterExpression is NOT of not_expression.
- filter¶
A primitive filter. All fields in filter in same FilterExpression needs to be either all dimensions or metrics.
- class google.analytics.data_v1beta.types.FilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A list of filter expressions. .. attribute:: expressions
A list of filter expressions.
- type
Sequence[google.analytics.data_v1beta.types.FilterExpression]
- class google.analytics.data_v1beta.types.GetMetadataRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for a property’s dimension and metric metadata. .. attribute:: name
Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID.
Example: properties/1234/metadata
Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.
- type
str
- class google.analytics.data_v1beta.types.Metadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The dimensions and metrics currently accepted in reporting methods.
- dimensions¶
The dimension descriptions.
- Type
Sequence[google.analytics.data_v1beta.types.DimensionMetadata]
- metrics¶
The metric descriptions.
- Type
- class google.analytics.data_v1beta.types.Metric(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The quantitative measurements of a report. For example, the metric
eventCount
is the total number of events. Requests are allowed up to 10 metrics.- name¶
The name of the metric. See the API Metrics for the list of metric names.
If
expression
is specified,name
can be any string that you would like within the allowed character set. For example ifexpression
isscreenPageViews/sessions
, you could call that metric’s name =viewsPerSession
. Metric names that you choose must match the regular expression^[a-zA-Z0-9_]$
.Metrics are referenced by
name
inmetricFilter
,orderBys
, and metricexpression
.- Type
- expression¶
A mathematical expression for derived metrics. For example, the metric Event count per user is
eventCount/totalUsers
.- Type
- class google.analytics.data_v1beta.types.MetricAggregation(value)[source]¶
Bases:
proto.enums.Enum
Represents aggregation of metrics.
- COUNT = 4¶
- MAXIMUM = 6¶
- METRIC_AGGREGATION_UNSPECIFIED = 0¶
- MINIMUM = 5¶
- TOTAL = 1¶
- class google.analytics.data_v1beta.types.MetricHeader(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Describes a metric column in the report. Visible metrics requested in a report produce column entries within rows and MetricHeaders. However, metrics used exclusively within filters or expressions do not produce columns in a report; correspondingly, those metrics do not produce headers.
- type_¶
The metric’s data type.
- class google.analytics.data_v1beta.types.MetricMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Explains a metric. .. attribute:: api_name
A metric name. Useable in Metric’s
name
. For example,eventCount
.- type
str
- ui_name¶
This metric’s name within the Google Analytics user interface. For example,
Event count
.- Type
- deprecated_api_names¶
Still usable but deprecated names for this metric. If populated, this metric is available by either
apiName
or one ofdeprecatedApiNames
for a period of time. After the deprecation period, the metric will be available only byapiName
.- Type
Sequence[str]
- type_¶
The type of this metric.
- class google.analytics.data_v1beta.types.MetricType(value)[source]¶
Bases:
proto.enums.Enum
A metric’s value type.
- METRIC_TYPE_UNSPECIFIED = 0¶
- TYPE_CURRENCY = 9¶
- TYPE_FEET = 10¶
- TYPE_FLOAT = 2¶
- TYPE_HOURS = 7¶
- TYPE_INTEGER = 1¶
- TYPE_KILOMETERS = 13¶
- TYPE_METERS = 12¶
- TYPE_MILES = 11¶
- TYPE_MILLISECONDS = 5¶
- TYPE_MINUTES = 6¶
- TYPE_SECONDS = 4¶
- TYPE_STANDARD = 8¶
- class google.analytics.data_v1beta.types.MetricValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The value of a metric. .. attribute:: value
Measurement value. See MetricHeader for type.
- type
str
- class google.analytics.data_v1beta.types.MinuteRange(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A contiguous set of minutes: startMinutesAgo, startMinutesAgo + 1, …, endMinutesAgo. Requests are allowed up to 2 minute ranges.
- start_minutes_ago¶
The inclusive start minute for the query as a number of minutes before now. For example,
"startMinutesAgo": 29
specifies the report should include event data from 29 minutes ago and after. Cannot be afterendMinutesAgo
.If unspecified,
startMinutesAgo
is defaulted to 29. Standard Analytics properties can request up to the last 30 minutes of event data (startMinutesAgo <= 29
), and 360 Analytics properties can request up to the last 60 minutes of event data (startMinutesAgo <= 59
).- Type
- end_minutes_ago¶
The inclusive end minute for the query as a number of minutes before now. Cannot be before
startMinutesAgo
. For example,"endMinutesAgo": 15
specifies the report should include event data from prior to 15 minutes ago.If unspecified,
endMinutesAgo
is defaulted to 0. Standard Analytics properties can request any minute in the last 30 minutes of event data (endMinutesAgo <= 29
), and 360 Analytics properties can request any minute in the last 60 minutes of event data (endMinutesAgo <= 59
).- Type
- class google.analytics.data_v1beta.types.NumericValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
To represent a number. .. attribute:: int64_value
Integer value
- type
int
- class google.analytics.data_v1beta.types.OrderBy(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The sort options. .. attribute:: metric
Sorts results by a metric’s values.
- type
google.analytics.data_v1beta.types.OrderBy.MetricOrderBy
- dimension¶
Sorts results by a dimension’s values.
- pivot¶
Sorts results by a metric’s values within a pivot column group.
- class DimensionOrderBy(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Sorts by dimension values. .. attribute:: dimension_name
A dimension name in the request to order by.
- type
str
- order_type¶
Controls the rule for dimension value ordering.
- class MetricOrderBy(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Sorts by metric values. .. attribute:: metric_name
A metric name in the request to order by.
- type
str
- class PivotOrderBy(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Sorts by a pivot column group. .. attribute:: metric_name
In the response to order by, order rows by this column. Must be a metric name from the request.
- type
str
- pivot_selections¶
Used to select a dimension name and value pivot. If multiple pivot selections are given, the sort occurs on rows where all pivot selection dimension name and value pairs match the row’s dimension name and value pair.
- class PivotSelection(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A pair of dimension names and values. Rows with this dimension pivot pair are ordered by the metric’s value.
For example if pivots = {{“browser”, “Chrome”}} and metric_name = “Sessions”, then the rows will be sorted based on Sessions in Chrome.
---------|----------|----------------|----------|---------------- | Chrome | Chrome | Safari | Safari ---------|----------|----------------|----------|---------------- Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions ---------|----------|----------------|----------|---------------- US | 2 | 2 | 3 | 1 ---------|----------|----------------|----------|---------------- Canada | 3 | 1 | 4 | 1 ---------|----------|----------------|----------|----------------
- class google.analytics.data_v1beta.types.Pivot(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Describes the visible dimension columns and rows in the report response.
- field_names¶
Dimension names for visible columns in the report response. Including “dateRange” produces a date range column; for each row in the response, dimension values in the date range column will indicate the corresponding date range from the request.
- Type
Sequence[str]
- order_bys¶
Specifies how dimensions are ordered in the pivot. In the first Pivot, the OrderBys determine Row and PivotDimensionHeader ordering; in subsequent Pivots, the OrderBys determine only PivotDimensionHeader ordering. Dimensions specified in these OrderBys must be a subset of Pivot.field_names.
- Type
- limit¶
The number of unique combinations of dimension values to return in this pivot. The
limit
parameter is required. Alimit
of 10,000 is common for single pivot requests.The product of the
limit
for eachpivot
in aRunPivotReportRequest
must not exceed 100,000. For example, a two pivot request withlimit: 1000
in each pivot will fail because the product is1,000,000
.- Type
- metric_aggregations¶
Aggregate the metrics by dimensions in this pivot using the specified metric_aggregations.
- Type
Sequence[google.analytics.data_v1beta.types.MetricAggregation]
- class google.analytics.data_v1beta.types.PivotDimensionHeader(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Summarizes dimension values from a row for this pivot. .. attribute:: dimension_values
Values of multiple dimensions in a pivot.
- type
Sequence[google.analytics.data_v1beta.types.DimensionValue]
- class google.analytics.data_v1beta.types.PivotHeader(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Dimensions’ values in a single pivot. .. attribute:: pivot_dimension_headers
The size is the same as the cardinality of the corresponding dimension combinations.
- type
Sequence[google.analytics.data_v1beta.types.PivotDimensionHeader]
- class google.analytics.data_v1beta.types.PropertyQuota(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Current state of all quotas for this Analytics Property. If any quota for a property is exhausted, all requests to that property will return Resource Exhausted errors.
- tokens_per_day¶
Standard Analytics Properties can use up to 25,000 tokens per day; Analytics 360 Properties can use 250,000 tokens per day. Most requests consume fewer than 10 tokens.
- tokens_per_hour¶
Standard Analytics Properties can use up to 5,000 tokens per hour; Analytics 360 Properties can use 50,000 tokens per hour. An API request consumes a single number of tokens, and that number is deducted from both the hourly and daily quotas.
- concurrent_requests¶
Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.
- server_errors_per_project_per_hour¶
Standard Analytics Properties and cloud project pairs can have up to 10 server errors per hour; Analytics 360 Properties and cloud project pairs can have up to 50 server errors per hour.
- potentially_thresholded_requests_per_hour¶
Analytics Properties can send up to 120 requests with potentially thresholded dimensions per hour. In a batch request, each report request is individually counted for this quota if the request contains potentially thresholded dimensions.
- class google.analytics.data_v1beta.types.QuotaStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Current state for a particular quota group. .. attribute:: consumed
Quota consumed by this request.
- type
int
- class google.analytics.data_v1beta.types.ResponseMetaData(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response’s metadata carrying additional information about the report content.
- class google.analytics.data_v1beta.types.Row(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Report data for each row. For example if RunReportRequest contains:
"dimensions": [ { "name": "eventName" }, { "name": "countryId" } ], "metrics": [ { "name": "eventCount" } ]
One row with ‘in_app_purchase’ as the eventName, ‘JP’ as the countryId, and 15 as the eventCount, would be:
"dimensionValues": [ { "value": "in_app_purchase" }, { "value": "JP" } ], "metricValues": [ { "value": "15" } ]
- dimension_values¶
List of requested dimension values. In a PivotReport, dimension_values are only listed for dimensions included in a pivot.
- Type
- metric_values¶
List of requested visible metric values.
- Type
- class google.analytics.data_v1beta.types.RunPivotReportRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request to generate a pivot report. .. attribute:: property
A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID. Within a batch request, this property should either be unspecified or consistent with the batch-level property.
Example: properties/1234
- type
str
- dimensions¶
The dimensions requested. All defined dimensions must be used by one of the following: dimension_expression, dimension_filter, pivots, order_bys.
- Type
- metrics¶
The metrics requested, at least one metric needs to be specified. All defined metrics must be used by one of the following: metric_expression, metric_filter, order_bys.
- Type
- date_ranges¶
The date range to retrieve event data for the report. If multiple date ranges are specified, event data from each date range is used in the report. A special dimension with field name “dateRange” can be included in a Pivot’s field names; if included, the report compares between date ranges. In a cohort request, this
dateRanges
must be unspecified.- Type
- pivots¶
Describes the visual format of the report’s dimensions in columns or rows. The union of the fieldNames (dimension names) in all pivots must be a subset of dimension names defined in Dimensions. No two pivots can share a dimension. A dimension is only visible if it appears in a pivot.
- Type
Sequence[google.analytics.data_v1beta.types.Pivot]
- dimension_filter¶
The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
- metric_filter¶
The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
- currency_code¶
A currency code in ISO4217 format, such as “AED”, “USD”, “JPY”. If the field is empty, the report uses the property’s default currency.
- Type
- cohort_spec¶
Cohort group associated with this request. If there is a cohort group in the request the ‘cohort’ dimension must be present.
- keep_empty_rows¶
If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
- Type
- return_property_quota¶
Toggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota.
- Type
- class google.analytics.data_v1beta.types.RunPivotReportResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response pivot report table corresponding to a pivot request.
- pivot_headers¶
Summarizes the columns and rows created by a pivot. Each pivot in the request produces one header in the response. If we have a request like this:
"pivots": [{ "fieldNames": ["country", "city"] }, { "fieldNames": "eventName" }]
We will have the following
pivotHeaders
in the response:"pivotHeaders" : [{ "dimensionHeaders": [{ "dimensionValues": [ { "value": "United Kingdom" }, { "value": "London" } ] }, { "dimensionValues": [ { "value": "Japan" }, { "value": "Osaka" } ] }] }, { "dimensionHeaders": [{ "dimensionValues": [{ "value": "session_start" }] }, { "dimensionValues": [{ "value": "scroll" }] }] }]
- Type
- dimension_headers¶
Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
- Type
Sequence[google.analytics.data_v1beta.types.DimensionHeader]
- metric_headers¶
Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
- Type
- rows¶
Rows of dimension value combinations and metric values in the report.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- aggregates¶
Aggregation of metric values. Can be totals, minimums, or maximums. The returned aggregations are controlled by the metric_aggregations in the pivot. The type of aggregation returned in each row is shown by the dimension_values which are set to “RESERVED_”.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- metadata¶
Metadata for the report.
- property_quota¶
This Analytics Property’s quota state including this request.
- class google.analytics.data_v1beta.types.RunRealtimeReportRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request to generate a realtime report. .. attribute:: property
A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID.
Example: properties/1234
- type
str
- dimensions¶
The dimensions requested and displayed.
- Type
- metrics¶
The metrics requested and displayed.
- Type
- dimension_filter¶
The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
- metric_filter¶
The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
- limit¶
The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for.
limit
must be positive.The API can also return fewer rows than the requested
limit
, if there aren’t as many dimension values as thelimit
. For instance, there are fewer than 300 possible values for the dimensioncountry
, so when reporting on onlycountry
, you can’t get more than 300 rows, even if you setlimit
to a higher value.- Type
- metric_aggregations¶
Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”.
- Type
Sequence[google.analytics.data_v1beta.types.MetricAggregation]
- order_bys¶
Specifies how rows are ordered in the response.
- Type
- return_property_quota¶
Toggles whether to return the current state of this Analytics Property’s Realtime quota. Quota is returned in PropertyQuota.
- Type
- minute_ranges¶
The minute ranges of event data to read. If unspecified, one minute range for the last 30 minutes will be used. If multiple minute ranges are requested, each response row will contain a zero based minute range index. If two minute ranges overlap, the event data for the overlapping minutes is included in the response rows for both minute ranges.
- Type
- class google.analytics.data_v1beta.types.RunRealtimeReportResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response realtime report table corresponding to a request.
- dimension_headers¶
Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
- Type
Sequence[google.analytics.data_v1beta.types.DimensionHeader]
- metric_headers¶
Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
- Type
- rows¶
Rows of dimension value combinations and metric values in the report.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- totals¶
If requested, the totaled values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- maximums¶
If requested, the maximum values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- minimums¶
If requested, the minimum values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- row_count¶
The total number of rows in the query result.
rowCount
is independent of the number of rows returned in the response and thelimit
request parameter. For example if a query returns 175 rows and includeslimit
of 50 in the API request, the response will containrowCount
of 175 but only 50 rows.- Type
- property_quota¶
This Analytics Property’s Realtime quota state including this request.
- class google.analytics.data_v1beta.types.RunReportRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The request to generate a report. .. attribute:: property
A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see where to find your Property ID. Within a batch request, this property should either be unspecified or consistent with the batch-level property.
Example: properties/1234
- type
str
- dimensions¶
The dimensions requested and displayed.
- Type
- metrics¶
The metrics requested and displayed.
- Type
- date_ranges¶
Date ranges of data to read. If multiple date ranges are requested, each response row will contain a zero based date range index. If two date ranges overlap, the event data for the overlapping days is included in the response rows for both date ranges. In a cohort request, this
dateRanges
must be unspecified.- Type
- dimension_filter¶
The filter clause of dimensions. Dimensions must be requested to be used in this filter. Metrics cannot be used in this filter.
- metric_filter¶
The filter clause of metrics. Applied at post aggregation phase, similar to SQL having-clause. Metrics must be requested to be used in this filter. Dimensions cannot be used in this filter.
- offset¶
The row count of the start row. The first row is counted as row 0.
When paging, the first request does not specify offset; or equivalently, sets offset to 0; the first request returns the first
limit
of rows. The second request sets offset to thelimit
of the first request; the second request returns the secondlimit
of rows.To learn more about this pagination parameter, see Pagination.
- Type
- limit¶
The number of rows to return. If unspecified, 10,000 rows are returned. The API returns a maximum of 100,000 rows per request, no matter how many you ask for.
limit
must be positive.The API can also return fewer rows than the requested
limit
, if there aren’t as many dimension values as thelimit
. For instance, there are fewer than 300 possible values for the dimensioncountry
, so when reporting on onlycountry
, you can’t get more than 300 rows, even if you setlimit
to a higher value.To learn more about this pagination parameter, see Pagination.
- Type
- metric_aggregations¶
Aggregation of metrics. Aggregated metric values will be shown in rows where the dimension_values are set to “RESERVED_(MetricAggregation)”.
- Type
Sequence[google.analytics.data_v1beta.types.MetricAggregation]
- order_bys¶
Specifies how rows are ordered in the response.
- Type
- currency_code¶
A currency code in ISO4217 format, such as “AED”, “USD”, “JPY”. If the field is empty, the report uses the property’s default currency.
- Type
- cohort_spec¶
Cohort group associated with this request. If there is a cohort group in the request the ‘cohort’ dimension must be present.
- keep_empty_rows¶
If false or unspecified, each row with all metrics equal to 0 will not be returned. If true, these rows will be returned if they are not separately removed by a filter.
- Type
- return_property_quota¶
Toggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota.
- Type
- class google.analytics.data_v1beta.types.RunReportResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response report table corresponding to a request. .. attribute:: dimension_headers
Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows.
- type
Sequence[google.analytics.data_v1beta.types.DimensionHeader]
- metric_headers¶
Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows.
- Type
- rows¶
Rows of dimension value combinations and metric values in the report.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- totals¶
If requested, the totaled values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- maximums¶
If requested, the maximum values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- minimums¶
If requested, the minimum values of metrics.
- Type
Sequence[google.analytics.data_v1beta.types.Row]
- row_count¶
The total number of rows in the query result.
rowCount
is independent of the number of rows returned in the response, thelimit
request parameter, and theoffset
request parameter. For example if a query returns 175 rows and includeslimit
of 50 in the API request, the response will containrowCount
of 175 but only 50 rows.To learn more about this pagination parameter, see Pagination.
- Type
- metadata¶
Metadata for the report.
- property_quota¶
This Analytics Property’s quota state including this request.