Learn R Programming

googleAnalyticsR (version 1.2.0)

segment_element: Make a segment element

Description

segment_element is the lowest hierarchy of segment creation, for which you will also need:

  • segment_define : AND combination of segmentFilters

  • segment_vector_simple or segment_vector_sequence

  • segment_element that are combined in OR lists for segment_vectors_*

Usage

segment_element(
  name,
  operator = c("REGEXP", "BEGINS_WITH", "ENDS_WITH", "PARTIAL", "EXACT", "IN_LIST",
    "NUMERIC_LESS_THAN", "NUMERIC_GREATER_THAN", "NUMERIC_BETWEEN", "LESS_THAN",
    "GREATER_THAN", "EQUAL", "BETWEEN"),
  type = c("METRIC", "DIMENSION"),
  not = FALSE,
  expressions = NULL,
  caseSensitive = NULL,
  minComparisonValue = NULL,
  maxComparisonValue = NULL,
  scope = c("SESSION", "USER", "HIT", "PRODUCT"),
  comparisonValue = NULL,
  matchType = c("PRECEDES", "IMMEDIATELY_PRECEDES")
)

Value

A SegmentFilterClause object

Arguments

name

Name of the GA metric or dimension to segment on

operator

How name shall operate on expression or comparisonValue

type

A metric or dimension based segment element

not

Should the element be the negation of what is defined

expressions

dim What the name shall compare to

caseSensitive

dim Whether to be case sensitive

minComparisonValue

dim Minimum comparison values for BETWEEN

maxComparisonValue

Max comparison value for BETWEEN operator

scope

met Scope of the metric value

comparisonValue

met What the name shall compare to

matchType

If used in sequence segment, what behaviour

See Also

Other v4 segment functions: segment_define(), segment_ga4, segment_vector_sequence(), segment_vector_simple()