Sub topic 8
Using segments to decide who sees what
This chapter assumes you know how contacts, lists and fields work, and that you can insert a merge tag and write a basic if/else block. Here you will learn how segments decide which contacts receive an email or a block of content. The next chapter uses them to build dynamic content blocks.
What a segment is
A segment is a saved set of rules that selects contacts from your data. Unlike a static list, a segment is evaluated against current contact data. A contact who changes plan or makes a purchase can move in or out of a segment without anyone editing a list.
Each rule has a field, an operator and a value. Rules combine with AND (all must match) or OR (any may match).
| Rule | Meaning |
|---|---|
| `plan` equals `pro` | Contacts on the Pro plan |
| `country` is one of `DE, AT, CH` | Contacts in German-speaking markets |
| `last_order_date` is within 90 days | Recent buyers |
| `plan` equals `free` AND `last_login` is older than 30 days | Inactive free users |
Segments versus conditional logic
Both tools answer the question "who sees what", but they work at different levels.
- A segment decides who receives the email, or which version of it. It is evaluated by the platform before sending.
- A conditional block decides what a single recipient sees inside one email. It is evaluated while that email renders.
Use a segment when the audiences need different subject lines, send times or whole emails. Use a conditional block when most of the email is shared and only a paragraph or banner changes.
Designing segments that behave well
- Define one clear purpose. "Pro customers in the EU who have not logged in for 30 days" is a segment. "Good customers" is not.
- Plan for overlap. A contact can match several segments. Decide which one wins, and put the most specific segment first when the platform evaluates them in order.
- Always include a default. Contacts with a blank or unexpected field value match no segment. Without a default, they get an empty space or no email.
- Choose the data source deliberately. Rules on profile fields use values you stored. Rules on behaviour, such as clicks or purchases, depend on tracking that may be delayed or blocked.
Segment membership inside a template
Some platforms expose segment membership or a tag to the template. Others only let you build separate content blocks and attach a segment rule to each. Syntax differs by platform, so check yours. A common pattern is to store the segment result as a contact field, then branch on it:
{% if customer.segment == "inactive_free" %}
We have not seen you in a while. Here is what is new.
{% elsif customer.segment == "pro" %}
Your Pro plan includes priority support.
{% else %}
Explore our plans.
{% endif %}The else branch is your default. It catches every contact whose segment is empty, misspelled or new.
Common errors
- Stale membership. Some platforms recalculate segments on a schedule, not at send time. A contact may be counted in a segment from yesterday's data. Check how often yours refreshes.
- Overlapping rules that contradict. If two blocks both match a contact, the contact may see both or only the first. Test this case on purpose.
- Rules that depend on missing data. "
countryis notUS" often includes contacts whose country is blank. Add an explicit "country is set" rule if that matters. - Segments that are too small. A segment with a handful of contacts is hard to test and measure. Merge it with a neighbour or fall back to a conditional block.
Exercise
A campaign has a "Pro customers" block and a "Free customers" block, each attached to a segment rule on the plan field. Some contacts have a blank plan. What do they see, and how do you fix it?
Show answer
They match neither segment, so they see no personalised block (or a gap, depending on the platform). Add a default block for contacts who match no segment, or in a template use an else branch that shows generic content such as "Explore our plans."