Distance events and sequence events are special kinds of events that you can create to measure the distance between events or to monitor if events occur in a specified sequence within a session.
Note: Distance and sequence events fire as soon as they occur in the session. They are not limited to the End of Session
trigger. The exception is when a sequence or distance event that is defined with a NOT exists
event condition. Distance and sequence events should not be configured to fire on the first hit of a session.
Recommendations
When you create distance and sequence events, Tealeaf recommends the following:
- Create the component events first. Test them and save them. Then, create the distance or sequence event that references those component events.
- If you deployed CX UI Capture for AJAX, avoid creating distance and sequence events that are based on events that track UI hits. Due to how UI hits are batched and submitted, determining distances and sequences among them is ambiguous and may lead to inaccurate results.
Distance events
A distance event evaluates the distance of the occurrence of two conditional events in order between a specified range of time (in seconds) or hits within the session.
Suppose you have a well-defined checkout process consisting of four pages. You could create a distance event to determine if people who are completing the first and last steps of the registration process are doing so in no more than four pages. Similarly, you could create another distance event to measure when the registration process exceeds a predetermined time, reporting values that exceed that threshold time.
- Hit-based distance events are measured based on the hit numbers in the session.
- Time-based distance events are measured based on the
ResponseTimeEx
timestamp, which is written as a request variable by the CX Passive Capture Application.
Condition types for distance events
For distance events, use the following operands for evaluation of a condition.
Exists in Session
- Tests whether the condition exists (Is true
) or does not (Is false
). Within the context of a distance event, this operator evaluates whether the condition occurred or did not occur within the specified range of hits or timeDimension Value
- Dimension values can be used in the conditions for distance events.Event Value
- Event values can be used in the conditions for distance events.
Evaluating not conditions
When the condition type is set to Exists in Session
and is configured to evaluate Is false
, you effectively create a not condition.
These not conditions are evaluated as did not occur within the specified range of hits or time.
When a not condition is defined as the second event condition, execution of the distance event is delayed to the end of the session, even though an in-session trigger is specified for the event because non-existence of an event cannot be determined until session end.
Distance event evaluation
Distance events can be configured to be evaluated in any trigger of the session. The range of hits that are evaluated is from the last tracked instance to the current hit.
Depending on the trigger in which the distance event is evaluated, the following values might be returned:
Trigger | Returnable Value |
---|---|
First Hit of Session , Every Hit , After Every
Hit , Last Hit |
Last value |
End of Session |
First, Minimum, Maximum, and Last values |
The calculation method applies to all four distances: first, last, minimum, and maximum. To find a distance between Event A and Event B:
- Event B is found.
- Step backwards through the session to find Event A.
- The distance between these two events is calculated. If the two events occur on the same hit, the distance is recorded as
0
(zero). - Pairs of events are gathered, and their distances and are calculated in this manner until all condition events are traversed for the session. This process may be shortened in some situations. For example, if the first distance is wanted, then when the first distance is found, the traversal of the condition events is stopped.In the worst case scenario, the maximum, minimum, and last distances are known after all event conditions are traversed.
The distance evaluation is reset if a complete match is found.
For example, assume that the events triggered as below and the event measures the distance between events A and B. Disregard the specified range for the first part of this example.
Hit Number | Event |
---|---|
1 | A |
2 | A |
3 | B |
4 | B |
5 | A |
6 | C |
7 | B |
Your allowable values would be as follows:
- First = 1: This value is the distance between event B on hit 3 and event A on hit 2.
- Last = 2: This value is the distance between event B on hit 7 and event A on hit 5.
- Minimum = 1
- Maximum = 2
The distance between event B on hit 4 and event A on hit 1 is not used because event A also occurred on hit 2. This scenario would reset the evaluation to start from hit 2. Event B on hit 4 is not used since a complete match is found by hit 3, which resets the evaluation. Event A does not occur again after the complete match (hit 3) and hit 4.
Hits 4 and 5 are not used because the events occur in the wrong order. B occurs first, followed by A. However, the conditions are looking for A then B.
If you specified that the distance must be 2 - 4 hits, then the first, last, minimum, and maximum values would all be 2. Only the match between event B on hit 7 and event A on hit 5 is at least 2 hits but less than 4 hits apart.
Because event B on hit 3 and event A on hit 2 are just 1 hit apart, that distance does not fall within the acceptable range and is discarded.
Sequence events
A sequence event detects when two or more events occur in a specified order in the session. The sequence event is used to detect that they fired and that they fired in a specific order. This event fires on the first detection of the sequence in the completed session.
Sequence events may be evaluated in any trigger of the session. Sequence events that are evaluated in the End of Session
trigger are always evaluated after dependent events in the trigger were evaluated.
Suppose there are three events: Add to Basket (A
), Error (B
), and Purchase (C
). In a session, the sequence of events occurs in the following order: A
, A
, B
, A
, C
, A
, B
. For a specified event sequence of A,B
, the events fires in the session even though Event A occurs again after Event B was fired for the first time. The event fires even though the visitor added an item to basket after the error, but they did not receive another error before the purchase.
All sequences are evaluated independently of each other. In this manner, you can create nested sequences.
Note: Events that occur on the same hit are always considered to be in the proper sequence.
Note: If you are mixing hit-based events and step-based events in your sequence, you should set the trigger to evaluate the event on After Every Hit
or End of
Session
. If the trigger is Every Hit
, the event is evaluated before the steps that are part of the event, and the sequence may not be properly evaluated. Step-based triggers can be created based on data that is submitted from the Tealeaf client frameworks.
Before you define an event of this type, you need to know each event and the sequence to test.
Condition
In the Condition step, select Events occur in the following
sequence
. Then, select the events as conditions in the order that they must occur in the session for the event to evaluate to true
.
Note: For sequence events, you can not use hit attributes as conditions.
Not conditions in sequence events: If the trailing event condition for a sequence event is configured to trigger when Exists in Session
is false
, then the sequence cannot be properly evaluated until the end of session. Although the Event Manager may indicate that the sequence is evaluated in a different trigger, the Event Engine performs the actual evaluation in the Last Hit
of session trigger. These not conditions are evaluated as "did not occur."
Distance values in sequence events
In a sequence of events, the distance is computed from the hit on which the first condition is true to the hit on which the last condition occurs.
- If the first condition is a not condition, for purposes of measuring distance, the first hit where the not condition evaluates to true is used.
- If the last condition is a not condition, for purposes of measuring distance, the ending hit is considered the last hit of the session.
When a sequence occurs multiple times in a session, the evaluation of the second and later sequences may begin on the hit where the last condition of the previous sequence occurrence was true. From that hit onward, the distance for these sequences begins to be measured from the hit where the first condition of the sequence is again satisfied.