Learn R Programming

ganalytics (version 0.10.7)

ScopeLevel: ScopeLevel

Description

Get or set the scope level of a .gaSegmentFilter or gaMetExpr.

Set the scope level of a .gaSegmentFilter or a gaMetExpr.

Usage

ScopeLevel(object, value)

ScopeLevel(object) <- value

# S4 method for gaSegMetExpr,missing ScopeLevel(object)

# S4 method for gaSegMetExpr,character ScopeLevel(object, value)

# S4 method for gaMetExpr,character ScopeLevel(object) <- value

# S4 method for .gaSegmentFilter,missing ScopeLevel(object)

# S4 method for .gaSegmentFilter,character ScopeLevel(object, value)

# S4 method for .gaSegmentFilter,character ScopeLevel(object) <- value

# S4 method for gaDynSegment,character ScopeLevel(object) <- value

Arguments

object

A .gaSegmentFilter or gaMetExpr object.

value

Optional new scope level to return an updated copy of the object with the new scope applied. For .gaSegmentFilters this can be either 'users' or 'sessions'. For metric expressions use either 'perUser', 'perSession', 'perHit' or 'perProduct'.

Value

The scope level as a character string, or returns a .gaSegmentFilter or gaMetExpr object with the newly set scope.

Methods (by class)

  • object = gaSegMetExpr,value = missing: Return the scope of the supplied metric used within a segment definition.

  • object = gaSegMetExpr,value = character: Set the scope, as described by a character value, to be applied to the supplied metric condition for use within a segment expression.

  • object = gaMetExpr,value = character: Set the scope, as described by a character value, to be applied to the supplied metric condition for use within a segment expression.

  • object = .gaSegmentFilter,value = missing: Returns the scope of the supplied .gaSegmentFilter.

  • object = .gaSegmentFilter,value = character: Set the scope level of a .gaSegmentFilter to either "user" or "session" level.

  • object = .gaSegmentFilter,value = character: Set the scope level of a .gaSegmentFilter to either "user" or "session" level.

  • object = gaDynSegment,value = character: Set the scope level of a gaDynSegment to either "user" or "session" level.

See Also

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

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

Examples

Run this code
# NOT RUN {
sessions_with_value <- Expr(~eventValue > 0, metricScope = "perSession")
ScopeLevel(sessions_with_value)
users_with_value_sessions <- Include(sessions_with_value)
ScopeLevel(users_with_value_sessions) <- "users"
sessions_with_value_segment <- ScopeLevel(users_with_value_sessions, "sessions")

# }

Run the code above in your browser using DataLab