Using AND/OR Logic
Combine segment rules with logical operators
Using AND/OR Logic in Segments
Mailnaptic segments support logical operators that control how multiple rules combine to determine segment membership. Understanding AND/OR logic is key to building precise audience segments.
AND Logic (Match All Rules)
When you select AND logic, a contact must satisfy every rule in the segment to be included. This narrows your audience because each additional rule is an extra requirement.
Example:
- Tag is “VIP” AND
- Email opened in last 30 days AND
- Site visited page “/pricing”
Result: only contacts who are tagged VIP, opened a recent email, and visited the pricing page.
OR Logic (Match Any Rule)
When you select OR logic, a contact only needs to satisfy at least one rule to be included. This broadens your audience because meeting any single condition is enough.
Example:
- Tag is “Trial user” OR
- Date added in last 7 days OR
- Site triggered event “signup_started”
Result: contacts who match any one (or more) of the three conditions.
Choosing the Right Logic Mode
| Goal | Logic | Why |
|---|---|---|
| Narrow, targeted audience | AND | Every rule must be true — only the most qualified contacts match. |
| Broad reach | OR | Any rule can be true — casts a wider net. |
| Exclude a sub-group | AND + negative filter | Combine AND logic with a “not” filter (e.g., “Tag is VIP” AND “Email not opened in 90 days”). |
How to Set Logic Mode
- Open your segment in the editor (create new or edit existing).
- At the top of the rules section, you will see the logic toggle: Match ALL rules (AND) or Match ANY rule (OR).
- Select the mode that fits your use case.
- Add your rules. The preview count updates in real time as you adjust.
Tips
- If you need complex nested logic (e.g., “(A AND B) OR (C AND D)”), consider creating two separate segments and targeting both in your campaign.
- Always check the contact count preview after switching logic modes — switching from AND to OR (or vice versa) can dramatically change your audience size.
- Start with AND logic for most marketing segments. OR logic is best for broad re-engagement or multi-criteria inclusion lists.