As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Analytics Data v1alpha API

class google.analytics.data_v1alpha.types.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.

Type

google.analytics.data_v1alpha.types.NumericValue

to_value

Ends with this number.

Type

google.analytics.data_v1alpha.types.NumericValue

class google.analytics.data_v1alpha.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 after end_date. The format NdaysAgo, yesterday, or today is also accepted, and in that case, the date is inferred based on the property’s reporting time zone.

Type

str

end_date

The inclusive end date for the query in the format YYYY-MM-DD. Cannot be before start_date. The format NdaysAgo, yesterday, or today is also accepted, and in that case, the date is inferred based on the property’s reporting time zone.

Type

str

name

Assigns a name to this date range. The dimension dateRange is valued to this name in a report response. If set, cannot begin with date_range_ or RESERVED_. If not set, date ranges are named by their zero based index in the request: date_range_0, date_range_1, etc.

Type

str

class google.analytics.data_v1alpha.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, the city could be “Paris” or “New York”.

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 a dimensionExpression concatenates country and city, you could call that dimension countryAndCity. Dimension names that you choose must match the regular expression ^[a-zA-Z0-9_]$.

Dimensions are referenced by name in dimensionFilter, orderBys, dimensionExpression, and pivots.

Type

str

dimension_expression

One dimension can be the result of an expression of multiple dimensions. For example, dimension “country, city”: concatenate(country, “, “, city).

Type

google.analytics.data_v1alpha.types.DimensionExpression

class google.analytics.data_v1alpha.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:

  1. lower_case(dimension)

  2. concatenate(dimension1, symbol, dimension2).

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

lower_case

Used to convert a dimension value to lower case.

This field is a member of oneof one_expression.

Type

google.analytics.data_v1alpha.types.DimensionExpression.CaseExpression

upper_case

Used to convert a dimension value to upper case.

This field is a member of oneof one_expression.

Type

google.analytics.data_v1alpha.types.DimensionExpression.CaseExpression

concatenate

Used to combine dimension values to a single dimension. For example, dimension “country, city”: concatenate(country, “, “, city).

This field is a member of oneof one_expression.

Type

google.analytics.data_v1alpha.types.DimensionExpression.ConcatenateExpression

class CaseExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Used to convert a dimension value to a single case.

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.

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

str

class google.analytics.data_v1alpha.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.

name

The dimension’s name.

Type

str

class google.analytics.data_v1alpha.types.DimensionValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The value of a dimension.

value

Value as a string if the dimension type is a string.

This field is a member of oneof one_value.

Type

str

class google.analytics.data_v1alpha.types.EventCriteriaScoping(value)[source]

Bases: proto.enums.Enum

Scoping specifies which events are considered when evaluating if an event meets a criteria.

EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0
EVENT_CRITERIA_WITHIN_SAME_EVENT = 1
class google.analytics.data_v1alpha.types.EventExclusionDuration(value)[source]

Bases: proto.enums.Enum

Enumerates options for how long an exclusion will last if an event matches the eventExclusionCriteria.

EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0
EVENT_EXCLUSION_PERMANENT = 1
class google.analytics.data_v1alpha.types.EventSegment(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Event segments are subsets of events that were triggered on your site or app. for example, all purchase events made in a particular location; app_exception events that occurred on a specific operating system.

event_inclusion_criteria

Defines which events are included in this segment. Optional.

Type

google.analytics.data_v1alpha.types.EventSegmentCriteria

exclusion

Defines which events are excluded in this segment. Optional.

Type

google.analytics.data_v1alpha.types.EventSegmentExclusion

class google.analytics.data_v1alpha.types.EventSegmentConditionGroup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Conditions tell Analytics what data to include in or exclude from the segment.

condition_scoping

conditionScoping should always be EVENT_CRITERIA_WITHIN_SAME_EVENT.

Optional. If unspecified, a conditionScoping of EVENT_CRITERIA_WITHIN_SAME_EVENT is used.

Type

google.analytics.data_v1alpha.types.EventCriteriaScoping

segment_filter_expression

Data is included or excluded from the segment based on if it matches this expression. Expressions express criteria on dimension, metrics, and/or parameters.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpression

class google.analytics.data_v1alpha.types.EventSegmentCriteria(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An event matches a criteria if the event meet the conditions in the criteria.

and_condition_groups

An event matches this criteria if the event matches each of these andConditionGroups.

Type

Sequence[google.analytics.data_v1alpha.types.EventSegmentConditionGroup]

class google.analytics.data_v1alpha.types.EventSegmentExclusion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Specifies which events are excluded in this segment.

event_exclusion_duration

eventExclusionDuration should always be PERMANENTLY_EXCLUDE.

Optional. If unspecified, an eventExclusionDuration of EVENT_EXCLUSION_PERMANENT is used.

Type

google.analytics.data_v1alpha.types.EventExclusionDuration

event_exclusion_criteria

If an event meets this condition, the event is excluded from membership in the segment for the eventExclusionDuration.

Type

google.analytics.data_v1alpha.types.EventSegmentCriteria

class google.analytics.data_v1alpha.types.Filter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An expression to filter dimension or metric values.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

field_name

The dimension name or metric name. Must be a name defined in dimensions or metrics.

Type

str

string_filter

Strings related filter.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.StringFilter

in_list_filter

A filter for in list values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.InListFilter

numeric_filter

A filter for numeric or date values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.NumericFilter

between_filter

A filter for between two values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.BetweenFilter

class google.analytics.data_v1alpha.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.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

and_group

The FilterExpressions in and_group have an AND relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FilterExpressionList

or_group

The FilterExpressions in or_group have an OR relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FilterExpressionList

not_expression

The FilterExpression is NOT of not_expression.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FilterExpression

filter

A primitive filter. In the same FilterExpression, all of the filter’s field names need to be either all dimensions or all metrics.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.Filter

class google.analytics.data_v1alpha.types.FilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A list of filter expressions.

expressions

A list of filter expressions.

Type

Sequence[google.analytics.data_v1alpha.types.FilterExpression]

class google.analytics.data_v1alpha.types.Funnel(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Configures the funnel in a funnel report request. A funnel reports on users as they pass through a sequence of steps. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys.

is_open_funnel

In an open funnel, users can enter the funnel in any step, and in a closed funnel, users must enter the funnel in the first step. Optional. If unspecified, a closed funnel is used.

Type

bool

steps

The sequential steps of this funnel.

Type

Sequence[google.analytics.data_v1alpha.types.FunnelStep]

class google.analytics.data_v1alpha.types.FunnelBreakdown(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Breakdowns add a dimension to the funnel table sub report response.

breakdown_dimension

The dimension column added to the funnel table sub report response. The breakdown dimension breaks down each funnel step. A valid breakdownDimension is required if funnelBreakdown is specified.

Type

google.analytics.data_v1alpha.types.Dimension

limit

The maximum number of distinct values of the breakdown dimension to return in the response. A limit of 5 is used if limit is not specified. Limit must exceed zero and cannot exceed 15.

This field is a member of oneof _limit.

Type

int

class google.analytics.data_v1alpha.types.FunnelEventFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Creates a filter that matches events of a single event name. If a parameter filter expression is specified, only the subset of events that match both the single event name and the parameter filter expressions match this event filter.

event_name

This filter matches events of this single event name. Event name is required.

This field is a member of oneof _event_name.

Type

str

funnel_parameter_filter_expression

If specified, this filter matches events that match both the single event name and the parameter filter expressions. Inside the parameter filter expression, only parameter filters are available.

This field is a member of oneof _funnel_parameter_filter_expression.

Type

google.analytics.data_v1alpha.types.FunnelParameterFilterExpression

class google.analytics.data_v1alpha.types.FunnelFieldFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An expression to filter dimension or metric values.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

field_name

The dimension name or metric name.

Type

str

string_filter

Strings related filter.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.StringFilter

in_list_filter

A filter for in list values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.InListFilter

numeric_filter

A filter for numeric or date values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.NumericFilter

between_filter

A filter for between two values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.BetweenFilter

class google.analytics.data_v1alpha.types.FunnelFilterExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Expresses combinations of funnel filters.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

and_group

The FunnelFilterExpression in andGroup have an AND relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelFilterExpressionList

or_group

The FunnelFilterExpression in orGroup have an OR relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelFilterExpressionList

not_expression

The FunnelFilterExpression is NOT of notExpression.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelFilterExpression

funnel_field_filter

A funnel filter for a dimension or metric.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelFieldFilter

funnel_event_filter

Creates a filter that matches events of a single event name. If a parameter filter expression is specified, only the subset of events that match both the single event name and the parameter filter expressions match this event filter.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelEventFilter

class google.analytics.data_v1alpha.types.FunnelFilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A list of funnel filter expressions.

expressions

The list of funnel filter expressions.

Type

Sequence[google.analytics.data_v1alpha.types.FunnelFilterExpression]

class google.analytics.data_v1alpha.types.FunnelNextAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Next actions state the value for a dimension after the user has achieved a step but before the same user has achieved the next step. For example if the nextActionDimension is eventName, then nextActionDimension in the ith funnel step row will return first event after the event that qualified the user into the ith funnel step but before the user achieved the i+1th funnel step.

next_action_dimension

The dimension column added to the funnel visualization sub report response. The next action dimension returns the next dimension value of this dimension after the user has attained the ith funnel step.

nextActionDimension currently only supports eventName and most Page / Screen dimensions like pageTitle and pagePath. nextActionDimension cannot be a dimension expression.

Type

google.analytics.data_v1alpha.types.Dimension

limit

The maximum number of distinct values of the breakdown dimension to return in the response. A limit of 5 is used if limit is not specified. Limit must exceed zero and cannot exceed 5.

This field is a member of oneof _limit.

Type

int

class google.analytics.data_v1alpha.types.FunnelParameterFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An expression to filter parameter values in a funnel.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

event_parameter_name

This filter will be evaluated on the specified event parameter. Event parameters are logged as parameters of the event. Event parameters include fields like “firebase_screen” & “currency”.

Event parameters can only be used in segments & funnels and can only be used in a descendent filter from an EventFilter. In a descendent filter from an EventFilter either event or item parameters should be used.

This field is a member of oneof one_parameter.

Type

str

item_parameter_name

This filter will be evaluated on the specified item parameter. Item parameters are logged as parameters in the item array. Item parameters include fields like “item_name” & “item_category”.

Item parameters can only be used in segments & funnels and can only be used in a descendent filter from an EventFilter. In a descendent filter from an EventFilter either event or item parameters should be used.

Item parameters are only available in ecommerce events. To learn more about ecommerce events, see the [Measure ecommerce] (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) guide.

This field is a member of oneof one_parameter.

Type

str

string_filter

Strings related filter.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.StringFilter

in_list_filter

A filter for in list values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.InListFilter

numeric_filter

A filter for numeric or date values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.NumericFilter

between_filter

A filter for between two values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.BetweenFilter

class google.analytics.data_v1alpha.types.FunnelParameterFilterExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Expresses combinations of funnel filters on parameters.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

and_group

The FunnelParameterFilterExpression in andGroup have an AND relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelParameterFilterExpressionList

or_group

The FunnelParameterFilterExpression in orGroup have an OR relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelParameterFilterExpressionList

not_expression

The FunnelParameterFilterExpression is NOT of notExpression.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelParameterFilterExpression

funnel_parameter_filter

A primitive funnel parameter filter.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.FunnelParameterFilter

class google.analytics.data_v1alpha.types.FunnelParameterFilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A list of funnel parameter filter expressions.

expressions

The list of funnel parameter filter expressions.

Type

Sequence[google.analytics.data_v1alpha.types.FunnelParameterFilterExpression]

class google.analytics.data_v1alpha.types.FunnelResponseMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The funnel report’s response metadata carries additional information about the funnel report.

sampling_metadatas

If funnel report results are sampled, this describes what percentage of events were used in this funnel report. One samplingMetadatas is populated for each date range. Each samplingMetadatas corresponds to a date range in order that date ranges were specified in the request.

However if the results are not sampled, this field will not be defined.

Type

Sequence[google.analytics.data_v1alpha.types.SamplingMetadata]

class google.analytics.data_v1alpha.types.FunnelStep(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Steps define the user journey you want to measure. Steps contain one or more conditions that your users must meet to be included in that step of the funnel journey.

name

The distinctive name for this step. If unspecified, steps will be named by a 1 based indexed name (i.e. “0. “, “1. “, etc.). This name defines string value returned by the funnelStepName dimension. For example, specifying name = Purchase in the request’s third funnel step will produce 3. Purchase in the funnel report response.

Type

str

is_directly_followed_by

If true, this step must directly follow the previous step. If false, there can be events between the previous step and this step. If unspecified, isDirectlyFollowedBy is treated as false.

Type

bool

within_duration_from_prior_step

If specified, this step must complete within this duration of the completion of the prior step. withinDurationFromPriorStep is inclusive of the endpoint at the microsecond granularity. For example a duration of 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1 microsecond.

withinDurationFromPriorStep is optional, and if unspecified, steps may be separated by any time duration.

This field is a member of oneof _within_duration_from_prior_step.

Type

google.protobuf.duration_pb2.Duration

filter_expression

The condition that your users must meet to be included in this step of the funnel journey.

Type

google.analytics.data_v1alpha.types.FunnelFilterExpression

class google.analytics.data_v1alpha.types.FunnelSubReport(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Funnel sub reports contain the dimension and metric data values. For example, 12 users reached the second step of the funnel.

dimension_headers

Describes dimension columns. Funnel reports always include the funnel step dimension in sub report responses. Additional dimensions like breakdowns, dates, and next actions may be present in the response if requested.

Type

Sequence[google.analytics.data_v1alpha.types.DimensionHeader]

metric_headers

Describes metric columns. Funnel reports always include active users in sub report responses. The funnel table includes additional metrics like completion rate, abandonments, and abandonments rate.

Type

Sequence[google.analytics.data_v1alpha.types.MetricHeader]

rows

Rows of dimension value combinations and metric values in the report.

Type

Sequence[google.analytics.data_v1alpha.types.Row]

metadata

Metadata for the funnel report.

Type

google.analytics.data_v1alpha.types.FunnelResponseMetadata

class google.analytics.data_v1alpha.types.InListFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The result needs to be in a list of string values.

values

The list of string values. Must be non-empty.

Type

Sequence[str]

case_sensitive

If true, the string value is case sensitive.

Type

bool

class google.analytics.data_v1alpha.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.

name

The metric’s name.

Type

str

type_

The metric’s data type.

Type

google.analytics.data_v1alpha.types.MetricType

class google.analytics.data_v1alpha.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_v1alpha.types.MetricValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The value of a metric.

value

Measurement value. See MetricHeader for type.

This field is a member of oneof one_value.

Type

str

class google.analytics.data_v1alpha.types.NumericFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Filters for numeric or date values.

operation

The operation type for this filter.

Type

google.analytics.data_v1alpha.types.NumericFilter.Operation

value

A numeric value or a date value.

Type

google.analytics.data_v1alpha.types.NumericValue

class Operation(value)[source]

Bases: proto.enums.Enum

The operation applied to a numeric filter

EQUAL = 1
GREATER_THAN = 4
GREATER_THAN_OR_EQUAL = 5
LESS_THAN = 2
LESS_THAN_OR_EQUAL = 3
OPERATION_UNSPECIFIED = 0
class google.analytics.data_v1alpha.types.NumericValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

To represent a number.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

int64_value

Integer value

This field is a member of oneof one_value.

Type

int

double_value

Double value

This field is a member of oneof one_value.

Type

float

class google.analytics.data_v1alpha.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.

Type

google.analytics.data_v1alpha.types.QuotaStatus

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.

Type

google.analytics.data_v1alpha.types.QuotaStatus

concurrent_requests

Standard Analytics Properties can send up to 10 concurrent requests; Analytics 360 Properties can use up to 50 concurrent requests.

Type

google.analytics.data_v1alpha.types.QuotaStatus

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.

Type

google.analytics.data_v1alpha.types.QuotaStatus

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.

Type

google.analytics.data_v1alpha.types.QuotaStatus

class google.analytics.data_v1alpha.types.QuotaStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Current state for a particular quota group.

consumed

Quota consumed by this request.

Type

int

remaining

Quota remaining after this request.

Type

int

class google.analytics.data_v1alpha.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

Sequence[google.analytics.data_v1alpha.types.DimensionValue]

metric_values

List of requested visible metric values.

Type

Sequence[google.analytics.data_v1alpha.types.MetricValue]

class google.analytics.data_v1alpha.types.RunFunnelReportRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request for a funnel report.

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

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.

Type

Sequence[google.analytics.data_v1alpha.types.DateRange]

funnel

The configuration of this request’s funnel. This funnel configuration is required.

Type

google.analytics.data_v1alpha.types.Funnel

funnel_breakdown

If specified, this breakdown adds a dimension to the funnel table sub report response. This breakdown dimension expands each funnel step to the unique values of the breakdown dimension. For example, a breakdown by the deviceCategory dimension will create rows for mobile, tablet, desktop, and the total.

Type

google.analytics.data_v1alpha.types.FunnelBreakdown

funnel_next_action

If specified, next action adds a dimension to the funnel visualization sub report response. This next action dimension expands each funnel step to the unique values of the next action. For example a next action of the eventName dimension will create rows for several events (i.e. session_start & click) and the total.

Next action only supports eventName and most Page / Screen dimensions like pageTitle and pagePath.

Type

google.analytics.data_v1alpha.types.FunnelNextAction

funnel_visualization_type

The funnel visualization type controls the dimensions present in the funnel visualization sub report response. If not specified, STANDARD_FUNNEL is used.

Type

google.analytics.data_v1alpha.types.RunFunnelReportRequest.FunnelVisualizationType

segments

The configurations of segments. Segments are subsets of a property’s data. In a funnel report with segments, the funnel is evaluated in each segment. Each segment specified in this request produces a separate row in the response; in the response, each segment identified by its name.

The segments parameter is optional. Requests are limited to 4 segments.

Type

Sequence[google.analytics.data_v1alpha.types.Segment]

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 the limit.

Type

int

dimension_filter

Dimension filters allow you to ask for only specific dimension values in the report. To learn more, see Creating a Report: Dimension Filters for examples. Metrics cannot be used in this filter.

Type

google.analytics.data_v1alpha.types.FilterExpression

return_property_quota

Toggles whether to return the current state of this Analytics Property’s quota. Quota is returned in PropertyQuota.

Type

bool

class FunnelVisualizationType(value)[source]

Bases: proto.enums.Enum

Controls the dimensions present in the funnel visualization sub report response.

FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0
STANDARD_FUNNEL = 1
TRENDED_FUNNEL = 2
class google.analytics.data_v1alpha.types.RunFunnelReportResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The funnel report response contains two sub reports. The two sub reports are different combinations of dimensions and metrics.

funnel_table

The funnel table is a report with the funnel step, segment, breakdown dimension, active users, completion rate, abandonments, and abandonments rate.

The segment dimension is only present in this response if a segment was requested. The breakdown dimension is only present in this response if it was requested.

Type

google.analytics.data_v1alpha.types.FunnelSubReport

funnel_visualization

The funnel visualization is a report with the funnel step, segment, date, next action dimension, and active users.

The segment dimension is only present in this response if a segment was requested. The date dimension is only present in this response if it was requested via the TRENDED_FUNNEL funnel type. The next action dimension is only present in the response if it was requested.

Type

google.analytics.data_v1alpha.types.FunnelSubReport

property_quota

This Analytics Property’s quota state including this request.

Type

google.analytics.data_v1alpha.types.PropertyQuota

kind

Identifies what kind of resource this message is. This kind is always the fixed string “analyticsData#runFunnelReport”. Useful to distinguish between response types in JSON.

Type

str

class google.analytics.data_v1alpha.types.SamplingMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

If funnel report results are sampled, this metadata describes what percentage of events were used in this funnel report for a date range. Sampling is the practice of analyzing a subset of all data in order to uncover the meaningful information in the larger data set.

samples_read_count

The total number of events read in this sampled report for a date range. This is the size of the subset this property’s data that was analyzed in this funnel report.

Type

int

sampling_space_size

The total number of events present in this property’s data that could have been analyzed in this funnel report for a date range. Sampling uncovers the meaningful information about the larger data set, and this is the size of the larger data set.

To calculate the percentage of available data that was used in this funnel report, compute samplesReadCount/samplingSpaceSize.

Type

int

class google.analytics.data_v1alpha.types.Segment(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A segment is a subset of your Analytics data. For example, of your entire set of users, one segment might be users from a particular country or city. Another segment might be users who purchase a particular line of products or who visit a specific part of your site or trigger certain events in your app.

To learn more, see GA4 Segment Builder.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

name

The name for this segment. If unspecified, segments are named “Segment”. This name defines string value returned by the segment dimension. The segment dimension prefixes segment names by the 1-based index number of the segment in the request (i.e. “1. Segment”, “2. Segment”, etc.).

Type

str

user_segment

User segments are subsets of users who engaged with your site or app.

This field is a member of oneof one_segment_scope.

Type

google.analytics.data_v1alpha.types.UserSegment

session_segment

Session segments are subsets of the sessions that occurred on your site or app.

This field is a member of oneof one_segment_scope.

Type

google.analytics.data_v1alpha.types.SessionSegment

event_segment

Event segments are subsets of events that were triggered on your site or app.

This field is a member of oneof one_segment_scope.

Type

google.analytics.data_v1alpha.types.EventSegment

class google.analytics.data_v1alpha.types.SegmentEventFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Creates a filter that matches events of a single event name. If a parameter filter expression is specified, only the subset of events that match both the single event name and the parameter filter expressions match this event filter.

event_name

This filter matches events of this single event name. Event name is required.

This field is a member of oneof _event_name.

Type

str

segment_parameter_filter_expression

If specified, this filter matches events that match both the single event name and the parameter filter expressions. Inside the parameter filter expression, only parameter filters are available.

This field is a member of oneof _segment_parameter_filter_expression.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilterExpression

class google.analytics.data_v1alpha.types.SegmentFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An expression to filter dimension or metric values.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

field_name

The dimension name or metric name.

Type

str

string_filter

Strings related filter.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.StringFilter

in_list_filter

A filter for in list values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.InListFilter

numeric_filter

A filter for numeric or date values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.NumericFilter

between_filter

A filter for between two values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.BetweenFilter

filter_scoping

Specifies the scope for the filter.

Type

google.analytics.data_v1alpha.types.SegmentFilterScoping

class google.analytics.data_v1alpha.types.SegmentFilterExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Expresses combinations of segment filters.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

and_group

The SegmentFilterExpression in andGroup have an AND relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpressionList

or_group

The SegmentFilterExpression in orGroup have an OR relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpressionList

not_expression

The SegmentFilterExpression is NOT of notExpression.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpression

segment_filter

A primitive segment filter.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentFilter

segment_event_filter

Creates a filter that matches events of a single event name. If a parameter filter expression is specified, only the subset of events that match both the single event name and the parameter filter expressions match this event filter.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentEventFilter

class google.analytics.data_v1alpha.types.SegmentFilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A list of segment filter expressions.

expressions

The list of segment filter expressions

Type

Sequence[google.analytics.data_v1alpha.types.SegmentFilterExpression]

class google.analytics.data_v1alpha.types.SegmentFilterScoping(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Scopings specify how the dimensions & metrics of multiple events should be considered when evaluating a segment filter.

at_any_point_in_time

If atAnyPointInTime is true, this filter evaluates to true for all events if it evaluates to true for any event in the date range of the request.

This atAnyPointInTime parameter does not extend the date range of events in the report. If atAnyPointInTime is true, only events within the report’s date range are considered when evaluating this filter.

This atAnyPointInTime is only able to be specified if the criteria scoping is ACROSS_ALL_SESSIONS and is not able to be specified in sequences.

If the criteria scoping is ACROSS_ALL_SESSIONS, atAnyPointInTime = false is used if unspecified.

This field is a member of oneof _at_any_point_in_time.

Type

bool

class google.analytics.data_v1alpha.types.SegmentParameterFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An expression to filter parameter values in a segment.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

event_parameter_name

This filter will be evaluated on the specified event parameter. Event parameters are logged as parameters of the event. Event parameters include fields like “firebase_screen” & “currency”.

Event parameters can only be used in segments & funnels and can only be used in a descendent filter from an EventFilter. In a descendent filter from an EventFilter either event or item parameters should be used.

This field is a member of oneof one_parameter.

Type

str

item_parameter_name

This filter will be evaluated on the specified item parameter. Item parameters are logged as parameters in the item array. Item parameters include fields like “item_name” & “item_category”.

Item parameters can only be used in segments & funnels and can only be used in a descendent filter from an EventFilter. In a descendent filter from an EventFilter either event or item parameters should be used.

Item parameters are only available in ecommerce events. To learn more about ecommerce events, see the [Measure ecommerce] (https://developers.google.com/analytics/devguides/collection/ga4/ecommerce) guide.

This field is a member of oneof one_parameter.

Type

str

string_filter

Strings related filter.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.StringFilter

in_list_filter

A filter for in list values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.InListFilter

numeric_filter

A filter for numeric or date values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.NumericFilter

between_filter

A filter for between two values.

This field is a member of oneof one_filter.

Type

google.analytics.data_v1alpha.types.BetweenFilter

filter_scoping

Specifies the scope for the filter.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilterScoping

class google.analytics.data_v1alpha.types.SegmentParameterFilterExpression(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Expresses combinations of segment filter on parameters.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

and_group

The SegmentParameterFilterExpression in andGroup have an AND relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilterExpressionList

or_group

The SegmentParameterFilterExpression in orGroup have an OR relationship.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilterExpressionList

not_expression

The SegmentParameterFilterExpression is NOT of notExpression.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilterExpression

segment_parameter_filter

A primitive segment parameter filter.

This field is a member of oneof expr.

Type

google.analytics.data_v1alpha.types.SegmentParameterFilter

class google.analytics.data_v1alpha.types.SegmentParameterFilterExpressionList(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A list of segment parameter filter expressions.

expressions

The list of segment parameter filter expressions.

Type

Sequence[google.analytics.data_v1alpha.types.SegmentParameterFilterExpression]

class google.analytics.data_v1alpha.types.SegmentParameterFilterScoping(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Scopings specify how multiple events should be considered when evaluating a segment parameter filter.

in_any_n_day_period

Accumulates the parameter over the specified period of days before applying the filter. Only supported if criteria scoping is ACROSS_ALL_SESSIONS or WITHIN_SAME_SESSION. Only supported if the parameter is event_count.

For example if inAnyNDayPeriod is 3, the event_name is “purchase”, the event parameter is “event_count”, and the Filter’s criteria is greater than 5, this filter will accumulate the event count of purchase events over every 3 consecutive day period in the report’s date range; a user will pass this Filter’s criteria to be included in this segment if their count of purchase events exceeds 5 in any 3 consecutive day period. For example, the periods 2021-11-01 to 2021-11-03, 2021-11-02 to 2021-11-04, 2021-11-03 to 2021-11-05, and etc. will be considered.

The date range is not extended for the purpose of having a full N day window near the start of the date range. For example if a report is for 2021-11-01 to 2021-11-10 and inAnyNDayPeriod = 3, the first two day period will be effectively shortened because no event data outside the report’s date range will be read. For example, the first four periods will effectively be: 2021-11-01 to 2021-11-01, 2021-11-01 to 2021-11-02, 2021-11-01 to 2021-11-03, and 2021-11-02 to 2021-11-04.

inAnyNDayPeriod is optional. If not specified, the segmentParameterFilter is applied to each event individually.

This field is a member of oneof _in_any_n_day_period.

Type

int

class google.analytics.data_v1alpha.types.SessionCriteriaScoping(value)[source]

Bases: proto.enums.Enum

Scoping specifies which events are considered when evaluating if a session meets a criteria.

SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0
SESSION_CRITERIA_WITHIN_SAME_EVENT = 1
SESSION_CRITERIA_WITHIN_SAME_SESSION = 2
class google.analytics.data_v1alpha.types.SessionExclusionDuration(value)[source]

Bases: proto.enums.Enum

Enumerates options for how long an exclusion will last if a session matches the sessionExclusionCriteria.

SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0
SESSION_EXCLUSION_PERMANENT = 2
SESSION_EXCLUSION_TEMPORARY = 1
class google.analytics.data_v1alpha.types.SessionSegment(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Session segments are subsets of the sessions that occurred on your site or app: for example, all the sessions that originated from a particular advertising campaign.

session_inclusion_criteria

Defines which sessions are included in this segment. Optional.

Type

google.analytics.data_v1alpha.types.SessionSegmentCriteria

exclusion

Defines which sessions are excluded in this segment. Optional.

Type

google.analytics.data_v1alpha.types.SessionSegmentExclusion

class google.analytics.data_v1alpha.types.SessionSegmentConditionGroup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Conditions tell Analytics what data to include in or exclude from the segment.

condition_scoping

Data is included or excluded from the segment based on if it matches the condition group. This scoping defines how many events the segmentFilterExpression is evaluated on before the condition group is determined to be matched or not. For example if conditionScoping = SESSION_CRITERIA_WITHIN_SAME_SESSION, the expression is evaluated on all events in a session, and then, the condition group is determined to be matched or not for this session. For example if conditionScoping = SESSION_CRITERIA_WITHIN_SAME_EVENT, the expression is evaluated on a single event, and then, the condition group is determined to be matched or not for this session.

Optional. If unspecified, a conditionScoping of WITHIN_SAME_SESSION is used.

Type

google.analytics.data_v1alpha.types.SessionCriteriaScoping

segment_filter_expression

Data is included or excluded from the segment based on if it matches this expression. Expressions express criteria on dimension, metrics, and/or parameters.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpression

class google.analytics.data_v1alpha.types.SessionSegmentCriteria(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A session matches a criteria if the session’s events meet the conditions in the criteria.

and_condition_groups

A session matches this criteria if the session matches each of these andConditionGroups.

Type

Sequence[google.analytics.data_v1alpha.types.SessionSegmentConditionGroup]

class google.analytics.data_v1alpha.types.SessionSegmentExclusion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Specifies which sessions are excluded in this segment.

session_exclusion_duration

Specifies how long an exclusion will last if a session matches the sessionExclusionCriteria.

Optional. If unspecified, a sessionExclusionDuration of SESSION_EXCLUSION_TEMPORARY is used.

Type

google.analytics.data_v1alpha.types.SessionExclusionDuration

session_exclusion_criteria

If a session meets this condition, the session is excluded from membership in the segment for the sessionExclusionDuration.

Type

google.analytics.data_v1alpha.types.SessionSegmentCriteria

class google.analytics.data_v1alpha.types.StringFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The filter for string

match_type

The match type for this filter.

Type

google.analytics.data_v1alpha.types.StringFilter.MatchType

value

The string value used for the matching.

Type

str

case_sensitive

If true, the string value is case sensitive.

Type

bool

class MatchType(value)[source]

Bases: proto.enums.Enum

The match type of a string filter

BEGINS_WITH = 2
CONTAINS = 4
ENDS_WITH = 3
EXACT = 1
FULL_REGEXP = 5
MATCH_TYPE_UNSPECIFIED = 0
PARTIAL_REGEXP = 6
class google.analytics.data_v1alpha.types.UserCriteriaScoping(value)[source]

Bases: proto.enums.Enum

Scoping specifies which events are considered when evaluating if a user meets a criteria.

USER_CRITERIA_ACROSS_ALL_SESSIONS = 3
USER_CRITERIA_SCOPING_UNSPECIFIED = 0
USER_CRITERIA_WITHIN_SAME_EVENT = 1
USER_CRITERIA_WITHIN_SAME_SESSION = 2
class google.analytics.data_v1alpha.types.UserExclusionDuration(value)[source]

Bases: proto.enums.Enum

Enumerates options for how long an exclusion will last if a user matches the userExclusionCriteria.

USER_EXCLUSION_DURATION_UNSPECIFIED = 0
USER_EXCLUSION_PERMANENT = 2
USER_EXCLUSION_TEMPORARY = 1
class google.analytics.data_v1alpha.types.UserSegment(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

User segments are subsets of users who engaged with your site or app. For example, users who have previously purchased; users who added items to their shopping carts, but didn’t complete a purchase.

user_inclusion_criteria

Defines which users are included in this segment. Optional.

Type

google.analytics.data_v1alpha.types.UserSegmentCriteria

exclusion

Defines which users are excluded in this segment. Optional.

Type

google.analytics.data_v1alpha.types.UserSegmentExclusion

class google.analytics.data_v1alpha.types.UserSegmentConditionGroup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Conditions tell Analytics what data to include in or exclude from the segment.

condition_scoping

Data is included or excluded from the segment based on if it matches the condition group. This scoping defines how many events the segmentFilterExpression is evaluated on before the condition group is determined to be matched or not. For example if conditionScoping = USER_CRITERIA_WITHIN_SAME_SESSION, the expression is evaluated on all events in a session, and then, the condition group is determined to be matched or not for this user. For example if conditionScoping = USER_CRITERIA_WITHIN_SAME_EVENT, the expression is evaluated on a single event, and then, the condition group is determined to be matched or not for this user.

Optional. If unspecified, conditionScoping = ACROSS_ALL_SESSIONS is used.

Type

google.analytics.data_v1alpha.types.UserCriteriaScoping

segment_filter_expression

Data is included or excluded from the segment based on if it matches this expression. Expressions express criteria on dimension, metrics, and/or parameters.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpression

class google.analytics.data_v1alpha.types.UserSegmentCriteria(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A user matches a criteria if the user’s events meet the conditions in the criteria.

and_condition_groups

A user matches this criteria if the user matches each of these andConditionGroups and each of the andSequenceGroups. andConditionGroups may be empty if andSequenceGroups are specified.

Type

Sequence[google.analytics.data_v1alpha.types.UserSegmentConditionGroup]

and_sequence_groups

A user matches this criteria if the user matches each of these andSequenceGroups and each of the andConditionGroups. andSequenceGroups may be empty if andConditionGroups are specified.

Type

Sequence[google.analytics.data_v1alpha.types.UserSegmentSequenceGroup]

class google.analytics.data_v1alpha.types.UserSegmentExclusion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Specifies which users are excluded in this segment.

user_exclusion_duration

Specifies how long an exclusion will last if a user matches the userExclusionCriteria.

Optional. If unspecified, userExclusionDuration of USER_EXCLUSION_TEMPORARY is used.

Type

google.analytics.data_v1alpha.types.UserExclusionDuration

user_exclusion_criteria

If a user meets this condition, the user is excluded from membership in the segment for the userExclusionDuration.

Type

google.analytics.data_v1alpha.types.UserSegmentCriteria

class google.analytics.data_v1alpha.types.UserSegmentSequenceGroup(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Define conditions that must occur in a specific order for the user to be a member of the segment.

sequence_scoping

All sequence steps must be satisfied in the scoping for the user to match the sequence. For example if sequenceScoping = USER_CRITERIA_WITHIN_SAME_SESSION, all sequence steps must complete within one session for the user to match the sequence. sequenceScoping = USER_CRITERIA_WITHIN_SAME_EVENT is not supported.

Optional. If unspecified, conditionScoping = ACROSS_ALL_SESSIONS is used.

Type

google.analytics.data_v1alpha.types.UserCriteriaScoping

sequence_maximum_duration

Defines the time period in which the whole sequence must occur; for example, 30 Minutes. sequenceMaximumDuration is inclusive of the endpoint at the microsecond granularity. For example a sequence with a maximum duration of 5 seconds can be completed at 4.9 or 5.0 seconds, but not 5 seconds and 1 microsecond.

sequenceMaximumDuration is optional, and if unspecified, sequences can be completed in any time duration.

Type

google.protobuf.duration_pb2.Duration

user_sequence_steps

An ordered sequence of condition steps. A user’s events must complete each step in order for the user to match the UserSegmentSequenceGroup.

Type

Sequence[google.analytics.data_v1alpha.types.UserSequenceStep]

class google.analytics.data_v1alpha.types.UserSequenceStep(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A condition that must occur in the specified step order for this user to match the sequence.

is_directly_followed_by

If true, the event satisfying this step must be the very next event after the event satifying the last step. If false, this step indirectly follows the prior step; for example, there may be events between the prior step and this step. isDirectlyFollowedBy must be false for the first step.

Type

bool

step_scoping

This sequence step must be satisfied in the scoping for the user to match the sequence. For example if sequenceScoping = WITHIN_SAME_SESSION, this sequence steps must complete within one session for the user to match the sequence. stepScoping = ACROSS_ALL_SESSIONS is only allowed if the sequenceScoping = ACROSS_ALL_SESSIONS.

Optional. If unspecified, stepScoping uses the same UserCriteriaScoping as the sequenceScoping.

Type

google.analytics.data_v1alpha.types.UserCriteriaScoping

segment_filter_expression

A user matches this sequence step if their events match this expression. Expressions express criteria on dimension, metrics, and/or parameters.

Type

google.analytics.data_v1alpha.types.SegmentFilterExpression