Sequence: Sequence

Description Usage Arguments Methods (by class) See Also Examples

Description

Create a new gaSequence object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Sequence(object, ..., negation, scope)

## S4 method for signature '.compoundExpr'
Later(object)

## S4 method for signature '.compoundExpr'
Then(object)

## S4 method for signature '.compoundExpr'
First(object)

## S4 method for signature 'ANY'
Sequence(object, ..., negation, scope)

Arguments

object

A sequence step or another expression that should be coerced to a sequence condition.

...

Other steps within the sequence condition, in the order in which they should be applied.

negation

Logical TRUE or FALSE to match segments where this sequence has not occurred.

scope

Optional scope, "users" or "sessions".

Methods (by class)

See Also

Other sequence segment functions: First, Later, Then

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
expr1 <- Expr(~pagepath == "/")
expr2 <- Expr(~eventCategory == "video")
expr3 <- Expr(~timeOnPage > 10)
expr4 <- Expr(~transactionRevenue > 10)
expr5 <- expr1 & expr2
expr6 <- Expr(~eventAction == "click")
expr7 <- Expr(~eventCategory == "video") & Expr(~eventAction == "play")
expr8 <- Expr(~source == "google")
Segment(
  PerUser(
    expr1,        # treat an expression as 'condition type segment filter' by default
    PerHit(expr3)
  ),
  Sequence(
    expr2,
    Then(expr4),  # 'then' means 'immediately followed by'.
    Later(expr5)  # 'later' means 'followed by', but not necessarily immediately.
  ),
  Sequence(
    First(expr6), # First expressly means 'first interaction' within the date range.
    Then(expr7),  # By default, treat an expression within a sequence as happening
    expr8         # at any point after any preceding steps in the sequence, i.e. 'later'.
  )
)

ganalytics documentation built on May 2, 2019, 8:34 a.m.