ganalytics (version 0.10.7)

DynSegment: DynSegment

Description

Combine one or more segment condition filters and/or sequence filters into a gaDynSegment that is scoped to either 'user' or 'session' level.

Usage

DynSegment(object, ..., name = character(0))

# S4 method for ANY DynSegment(object, ..., name = character(0))

# S4 method for gaDynSegment DynSegment(object)

Arguments

object

The first filter to include in the segment definition.

...

Additional filters to include in the segment definition, if needed.

name

An optional name given to the dynamic segment.

Value

A gaDynSegment object.

Methods (by class)

  • ANY: Defines a list of filters from one or more expressions applied using the specified scope.

  • gaDynSegment: Returns itself.

Details

Segment filter are either sequential or non-sequential conditions. Sequential and non-sequential conditions can be combined using this function.

See Also

Other dynamic segment functions: Exclude, Include, IsNegated, PerHit, PerProduct, PerSession, PerUser, ScopeLevel, SegmentConditionFilter, Segments, Segment

Examples

Run this code
# NOT RUN {
return_shoppers <- SegmentConditionFilter(
  Expr(~transactions > 1, metricScope = "perUser"),
  scope = "users"
)
watched_video_then_purchased <- Sequence(
  Expr(~eventCategory == "video") & Expr(~eventAction == "play"),
  Later(Expr(~transactions > 0))
)

# }

Run the code above in your browser using DataCamp Workspace