In this article, learn how to use AND and OR to combine multiple criteria and build targeted segments for your analysis.
Before you begin
- AND is available on Free, Growth, Pro, and Enterprise plans.
- OR and Groups are available on Growth, Pro, and Enterprise plans only.
What you're analyzing and why it's important
When you combine criteria, you focus your analysis on specific groups of users instead of looking at all your traffic at once.
Combining criteria helps you:
Narrow your focus: Filter down to the exact group of users you want to analyze, so your results are more relevant and easier to act on.
Build detailed segments: Create segments that reflect real user behaviors, like "users who viewed a product page, added to cart, but didn't complete checkout."
Understand user journeys: Track the specific paths users take through your site to identify what's working well and where users are struggling.
How And and Or work in segments
When you combine criteria, you control how they work together using AND or OR.
AND narrows your segment by requiring users to meet all the criteria you set. Use it when you want to focus on a specific group.
Example: "New users" AND "Reached cart page" returns only sessions where the user is new and reached the cart page. Both criteria must be true.
OR broadens your segment by including users who meet any of the criteria you set. Use it when you want to capture a wider group.
Example: "Reached cart page" OR "Viewed checkout" returns sessions where users reached the cart page, viewed checkout, or both. At least one criterion must be true.
How to use AND when building a segment
-
Go to 'Analysis setup' > 'Segments'.
-
Click 'New segment'.
- Name your segment.
- From the dropdown, choose your first criteria type and set the values. For example, select Segments and choose 'New users'.
-
Click '+ Add condition' and select 'AND'.
-
Choose your second criteria type and set the values. For example, select 'User actions' and choose Viewed page > "Cart page."
- Repeat steps 4 and 5 to add more criteria as needed.
- Click 'Create'.
If you're using Goals as a criteria type, you can include up to 9 goals in a single segment.
How to use groups for more advanced segments
available on Growth, Pro, and Enterprise plans only
Groups let you combine AND and OR together in the same segment. For example: "Criteria A AND (Criteria B OR Criteria C)." Think of groups as a way to control which criteria are checked together first.
- Set up your first criteria.
-
Click '+ Add a group of conditions'.
-
Choose whether this group should connect to your other criteria using AND or OR.
- Set up the criteria.
- Click 'Create' when you're done.
Tips to help you combine segments
Start simple: Begin with one or two criteria and check your traffic summary. Then add more criteria to narrow your segment down as needed.
Choose the right approach for your goal:
- Use AND to be more restrictive — all criteria must be true
- Use OR to be more inclusive — any criteria can be true
Use groups for advanced rules: When you need to combine AND and OR in the same segment, use groups to control which criteria are evaluated together — similar to how brackets work in a calculation.
Use meaningful names: Name your segment based on what it contains, for example "Mobile cart abandoners - UK" instead of "Segment 1."
Balance specificity and volume: Too many AND criteria may leave you with too few users to draw conclusions from. Too many OR criteria may make your segment too broad to be useful. Check your traffic summary as you build to find the right balance.
What to read next
- How to create a segment: Step-by-step instructions for building your first segment.