Build sequential segments
Sequential segments are created by using the THEN operator, instead of AND or OR. THEN implies that one segment criteria occurs, followed by another. By default, a sequential segment identifies all matching data, showing the filter âInclude Everyoneâ. Sequential segments can be further filtered to a subset of matching hits using the âOnly Before Sequenceâ and âOnly After Sequenceâ options.
Additionally, you can constrain sequential segments to a specific duration of time, granularity, and counts between checkpoints using the After and Within operators.
Here is a video on sequential segmentation:
Include Everyone section_75ADDD5D41F04800A09E592BB2940B35
When creating a segment where âInclude Everyoneâ is set, the segment identifies paths that match the given pattern as a whole. This is an example of a basic sequence segment looking for one hit (Page A) followed by another (Page B) as visited by the same visitor. The segment is set to Include Everyone.
A then (in a different visit) B
A then D then B
Only Before Sequence and Only After Sequence section_736E255C8CFF43C2A2CAAA6D312ED574
The options Only Before Sequence and Only After Sequence filter the segment to a subset of data before or after the specified sequence.
- Only Before Sequence: Includes all hits before a sequence + the first hit of the sequence itself (see example 1, 3). If a sequence appears multiple times in a path, âOnly Before Sequenceâ includes the first hit of the last occurrence of the sequence and all prior hits (see example 2).
- Only After Sequence: Includes all hits after a sequence + the last hit of the sequence itself (see example 1, 3). If a sequence appears multiple times in a path, âOnly Afterâ includes last hit of the first occurrence of the sequence and all subsequent hits (see example 2).
For example, consider a sequence of B -> D. The three filters would identify hits as follows:
Example 1: B then D appears once
Example 2: B then D appears multiple times
Letâs also frame this concept with the Hit Depth dimension.
Example 3: Hit Depth 3 then 5
Dimension Constraints section_EAFD755F8E674F32BCE9B642F7F909DB
In a âwithinâ clause, in between THEN statements, you can add, for example, âwithin 1 search keyword instanceâ, âwithin 1 eVar 47 instanceâ. This constrains the segment to within one instance of a dimension.
Setting a âWithin Dimensionâ clause between rules allows a segment to restrict data to sequences where that clause is satisfied. See the example below, where the constraint is set to âWithin 1 pageâ:
Note: If the dimension restriction is taken out, âA then Bâ and âA then C then Bâ would both match.
Simple Page View sequence
Identify visitors who viewed a page and then viewed another page. The hit-level data will filter this sequence irrespective of previous, past, or interim visit sessions or the time or number of page views occurring between.
Example: Visitor viewed page A, then viewed page B in the same or another visit.
Use cases
The following are examples of how the segment can be used.
- Visitors to a sportsâ site view the football landing page and then view the basketball landing page in sequential order but not necessarily on the same visit. This prompts a campaign to push basketball content to football viewers during the football season.
- Car retailer identifies a relationship between those who land on the customer loyalty page and then go to the video page at any time during the visit or another visit.
Create this segment
You nest two page rules within a top-level Visitor container and sequence the page hits using the THEN operator.
Visitor sequence across visits
Identify those visitors who fell out of a campaign but then returned to the sequence of page views in another session.
Example: Visitor viewed page A in one visit, then viewed page B in another visit.
Use Cases
The following are examples of how this type of segment can be used:
- Visitors to the Sports page of a news site then revisits the Sports page in another session.
- A clothes retailer sees a relationship between visitors who land on a landing page in one session, and then go directly to the checkout page in another session.
Create this Segment
This example nests two Visit containers within the top-level Visitor container and sequences the segment using the THEN operator.
Mixed-level sequence
Identify visitors who view two pages across an undetermined number of visits, but then view a third page in a separate visit.
Example: Visitors visit page A and then page B in one or more visits, followed by a visit to page C in a separate visit.
Use Cases
The following are examples of how this type of segment can be used:
- Visitors first visit a news site and then view the sports page in the same visit. On another visit the visitor visits the weather page.
- Retailer defines visitors who enter the Main page and then go to the My Account page. In another visit, they visit the View Cart page.
Create this segment
- Drop two Page dimensions from the left panes within a top-level Visitor container.
- Add the THEN operator between them.
- Click Options > Add container and add a Visit container underneath the Visitor level and sequenced using the THEN operator.
Aggregate containers
Adding multiple Hit containers within a Visitor container lets you employ the appropriate operators between the same type of containers, and to use rules and dimensions such as Page and Visit Number to define the page view and provide a sequence dimension within the Hit container. Applying logic at the Hit-level lets you constrain and combine matches at a same-level of hits within the Visitor container to build a variety of segment types.
Example: Visitors visited page A after the first hit in the sequence of page views (page D in the example), then visited either page B or page C without regard to the number of visits.
Use Cases
The following are examples of how this type of segment can be used:
- Identify visitors who go to the Main landing page in one visit, then view the Menâs clothing page in another visit, then view either the Womanâs or Childrenâs landing page in a different visit.
- An e-zine captures those visitors who go to the Home page in one visit, the Sports page in another visit, and the Opinion page in another visit.
Create this segment
-
Select the Visitor container as the top-level container.
-
Add two Hit-level containersâa dimension with an appropriate numerical dimension joined at the same Hit level by the AND and OR operator.
-
Within the Visit container, add another Hit container and nest two additional Hit containers joined with an OR or AND operator.
Sequence these nested Hit containers with the THEN operator.
âNestingâ in sequential segments
By placing checkpoints at both the Visit and Hit level, you can constrain the segment to meet requirements within a specific visit as well as a specific hit.
Example: Visitor visited page A then visited page B in the same visit. In a new visit, the visitor then went to page C.
Create this segment
- Underneath a top-level Visit container, drag in two page dimensions.
- Multi-select both rules, click Options > Add container from selection and change it to a Visit container.
- Join them with a THEN operator.
- Create a Hit container as a peer to the Visit container and drag in a page dimension.
- Join the nested sequence in the Visit container with the Hit container using another THEN operator.
Exclude hits
Segment rules include all data unless you specifically exclude Visitor, Visit, or Hit data using the Exclude rule. It allows you to dismiss common data and create segments with more focus. Or it allows you to create segments excluding found groups to identify the remaining data set, such as creating a rule that includes successful visitors who placed orders and then excluding them to identify ânon-purchasers.â However, in most cases it is better to create rules that exclude broad values rather than trying to use the Exclude rule to target specific include values.
For example:
- Exclude pages. Use a segment rule to strip out a specific page (such as
Home Page
) from a report, create a Hit rule where the page equals âHome Page,â and then exclude it. This rule automatically includes all values except the Home Page. - Exclude referring domains. Use a rule that includes only referring domains from Google.com and excludes all others.
- Identify non-purchasers. Identify when orders are greater than zero and then exclude the Visitor.
The Exclude operator can be employed to identify a sequence where specific visits or hits are not performed by the visitor. Exclude Checkpoints can also be included within a Logic Group.
Exclude between checkpoints
Enforce logic to segment visitors where a checkpoint did not explicitly occur between two other checkpoints.
Example: Visitors that visited page A and then visited page Câbut did not visit page B.
Use Cases
The following are examples of how this type of segment can be used:
- Visitors to a Lifestyle page and then the Theater section without going to the Arts page.
- An auto retailer sees a relationship between those who visit the main landing page and then go straight to the No Interest campaign without going to the Vehicle page.
Create this segment
Create a segment as you would for a simple, mixed-level, or nested sequential segment and then set the EXCLUDE operator for the container element. The example below is an aggregate segment where the three Hit containers are dragged to the canvas, the THEN operator assigned to join the container logic, then exclude the middle page view container to include only visitors that went from page A to Page C in the sequence.
Exclude at beginning of sequence
If the exclude checkpoint is at the beginning of a sequential segment, then it ensures that an excluded page view did not occur before the first non-excluded hit.
For example, A restaurant wants to see users who tend to avoid the main landing page and go directly to the Order Out page. You can view this data by excluding hits to the landing page and including hits to the Order Out page in a sequential segment.
Create this segment
Create two separate Hit containers within a top-level Visitor container. Then set the EXCLUDE operator for the first container.
Exclude at end of sequence
If the exclude checkpoint is at the end of a sequence, then it ensures that the checkpoint did not happen between the last non-excluded checkpoint and the end of the visitor sequence.
For example, a clothing store wants to see all visitors that viewed a product page but never visited their shopping cart afterward. This example can be simplified to a visitor going to page A then never going to page B in current or subsequent visits.
Create this segment
Build a simple sequence segment by dragging two Hit containers to the canvas and connecting them using the THEN operator. Then assign the EXCLUDE operator to the second Hit container in the sequence.
Logic Group containers
Logic Group containers are required to group conditions into a single sequential segment checkpoint. The special Logic Group container is available only in sequential segmentation, to ensure its conditions are met after any prior sequential checkpoint and before any following sequential checkpoint. The conditions within the Logic Group checkpoint itself may be met in any order. By contrast, non-sequential containers (hit, visit, visitor) do not require their conditions to be met within the overall sequence, producing unintuitive results if used with a THEN operator.
The Logic Group container was designed to treat several checkpoints as a group, without any ordering among the grouped checkpoints. In other words, we donât care about the order of the checkpoints within that group. For example, you canât nest a Visitor container within a Visitor container. But instead, you can nest a Logic Group container within a Visitor container with specific Visit-level and Hit-level checkpoints.
Logic groups may seem daunting - here are some best practices on how to use them:
Logic Group or Hit/Visit container?
If you want to group sequential checkpoints, then your âcontainerâ is Logic Group. However, if those sequential checkpoints must occur within a single hit or visit scope, then a âhitâ or a âvisitâ containers are required. (Of course, âhitâ does not make sense for a group of sequential checkpoints, when one hit may credit no more than one checkpoint).
Do Logic Groups simplify building sequential segments?
Yes, they can. Letâs assume you are trying to identify this segment of visitors: Visitors that viewed page A, then viewed each of the pages of B, C, and D
You can build this segment without a Logic Group container, but itâs complex and laborious. You must specify every sequence of pages that the visitor could view:
Visitor Container [Page A THEN Page B THEN Page C THEN Page D] or
Visitor Container [Page A THEN Page B THEN Page D THEN Page C] or
Visitor Container [Page A THEN Page C THEN Page B THEN Page D] or
Visitor Container [Page A THEN Page C THEN Page D THEN Page B] or
Visitor Container [Page A THEN Page D THEN Page B THEN Page C] or
Visitor Container [Page A THEN Page D THEN Page C THEN Page B]
A Logic Group container greatly simplifies building this segment, as shown here:
Build a Logic Group segment section_A5DDC96E72194668AA91BBD89E575D2E
Like other containers, Logic Group containers can be built in multiple ways within the Segment Builder. Here is a preferred way to nest Logic Group containers:
- Drag dimensions, events, or segments from the left panes.
- Change the top container to a Visitor container.
- Change the AND or OR operator inserted by default to the THEN operator.
- Select the Hit containers (the Dimension, Event, or Item) and click Options > Add container from selection.
- Click the container icon and select Logic Group.
- You can now set the Hit within the Logic Group container without regard to hierarchy.
Logic Group checkpoints in any order
Using the Logic Group lets you meet conditions within that group that reside outside of the sequence. This allows you to build segments where a Visit or Hit container happens irrespective of the normal hierarchy.
Example: Visitors who visited page A, then visited page B and page C in any order.
Create this segment
Page B and C are nested in a Logic Group container within the outer Visitor container. The Hit container for A is then followed by the Logic Group container with B and C identified using the AND operator. Because it is in the Logic Group, the sequence is not defined and hitting both page B and C in any order makes the argument true.
Another example: Visitors who visited page B or page C, then visited page A:
The segment must match at lease one of the logic groupâs checkpoints (B or C). Also, logic group conditions may be met in the same hit or across multiple hits.â
Logic Group first match
Using the Logic Group lets you meet conditions within that group that reside outside of the sequence. In this unordered first match segment, the Logic Group rules are identified first to be either a page view of page B or page C, then the required view of page A.
Example: Visitors that visited either page B or page C, then visited page A.
Create this segment
Page B and page C dimensions are grouped within a Logic Group container with the OR operator selected, then the Hitcontainer identifying a page view of page A as the value.
Logic Group exclude AND
Build segments using the Logic Group where multiple page views are aggregated to define what pages were necessary to be hit while other pages were specifically missed. ****
Example: Visitor visited Page A, then explicitly did not visit page B or C, but hit page D.
Create this segment
Build this segment by dragging Dimensions, Events, and pre-built Segments from the left panes. See Building a Logic Group Segment.
After nesting the values within the Logic Group, click the Exclude button within the Logic Group container.
Logic Group exclude OR
Build segments using the Logic Group where multiple page views are aggregated to define what pages were necessary to be hit while other pages were specifically missed.
Example: Visitors that visited page A, but did not visit either Page B or Page C before Page A.
Create this segment
The initial B and C pages are identified in a Logic Group container that is excluded, and then followed by a hit to page A by the visitor.
Build this segment by dragging Dimensions, Events, and pre-built Segments from the left panes.
After nesting the values within the Logic Group, click the Exclude button within the Logic Group container.
Build time-within and time-after segments
Use the Within and After operators built in to the header of each container to define the time, events, and count.
You can limit matching to a specified duration of time by using the Within and After containers and specifying a granularity and count. The Within operator is used to specify a max limit on the amount of time between two checkpoints. The After operator is used to specify a minimum limit on the amount of time between two checkpoints.
After and Within Operators section_CCAF5E44719447CFA7DF8DA4192DA6F8
The duration is specified by a single uppercase letter representing the granularity followed by a number representing the repetition count of the granularity.
Within includes the endpoint (less than or equal to).
After does not include the endpoint (greater than).
After = 1 Week(s) and Within = 2 Week(s)
Then the conditions to identify visitors in the segment are met only between 1 and 2 weeks. Both conditions are enforced from the time of the first page hit.
Use the After operator
- Time After lets you track by year, month, day, hour, and minute to match visits.
- Time After can only be applied to a Hit container because it is the only level for which such fine granularity is defined.
Example: Visitors that visited page A then visited page B only after 2 weeks.****
Create the Segment: This segment is created by adding a Visitor container with two Hit containers. You can then set the THEN operator, and open the AFTER operator drop down and set the number of weeks.
Matches
When given âAfter 2 weeksâ, if a hit to page A happens on June 1 2019, at 00:01, then a following hit to page B will match as long as it comes before June 15 2019 00:01 (14 days later).
Use the Within operator
- Within lets you track by year, month, day, hour, and minute to match visits.
- Within can only be applied to a Hit container because it is the only level for which such fine granularity is defined.
Example: Visitors who visited page A then visited page B within 5 minutes.
Create the segment: This segment is created by adding a Visitor container, then dragging with two Hit containers. You can then set the THEN operator, and open the AFTER operator drop down and set the interval: hits, page views, visits, minutes, hours, days, weeks, months, quarters, or years.
Matches
Matches must occur within the time limit. For the expression , if a visitor hits page A happens at 00:01, then a following hit to page B will match as long as it comes on or before 00:06 (five minutes later, including the same minute). Hits within the same minute will also match.
The Within and After operators
Use Within and After to provide a maximum and minimum endpoint at both ends of a segment.
Example: Visitors that visited page A then visited page B after 2 weeks but within 1 month.
Create the Segment: Create the segment by sequencing two Hit containers within a Visitor container. Then set the After and Within operators.
Matches
Any visitors hitting page A on June 1, 2019 are returning after June 15, 2019 00:01, but before July 1, 2019 are included in the segment. Compare with Time Between Exclusions.
The After and Within operators can be used together to define a sequential segment.
This example depicts a second visit to hit page B after two weeks but within a month.