Sub topic 5
Static and dynamic segments
This chapter assumes you can write a segment rule with conditions, AND/OR/NOT, and a time window. The previous chapter covered those. It also assumes you have used an email service provider (ESP) or CRM that has a segment builder. The SQL examples use PostgreSQL. If you do not read SQL, follow the prose and the diagram.
Once you have a rule, you must decide when it is evaluated. That choice splits segments into two kinds, and it affects who receives a message, whether the audience can be reproduced later, and whether consent is respected at send time.
The two kinds of segment
A dynamic segment stores a rule. Membership is computed from the current data each time the segment is read. A subscriber who clicks an email today may enter the segment tomorrow. A subscriber who stops clicking leaves it when the click ages out of the time window.
A static segment stores a list of subscribers. Membership was decided once, at the moment the list was built or imported, and it does not change unless someone edits the list. The rule that produced the list, if any, is not re-run.
The difference is when the condition is checked.
| Property | Dynamic segment | Static segment |
|---|---|---|
| What is stored | The rule | The list of members |
| When membership is decided | Each time the segment is evaluated | Once, when the list is created or edited |
| Responds to new behaviour | Yes | No |
| Reproducible after the fact | Not by itself | Yes |
| Typical sources | Behavioural, interest, lifecycle rules | Event attendee lists, imports, manual picks, frozen audiences |
| Main risk | Audience changes while you are using it | Audience goes stale |
Many ESPs label these differently. Some call dynamic segments "smart lists" or "live segments", and static ones "lists" or "groups". Check how your tool defines them. Some tools only re-evaluate on a schedule, which is a third behaviour described below.
How a dynamic segment is evaluated
A rule such as "clicked an email in the last 30 days" contains a moving reference point. The phrase "last 30 days" means now() minus 30 days, and now() changes. A dynamic segment is therefore a function of time as well as of data.
The simplest way to model this in a database is a view. A view stores a query and runs it on every read.
-- PostgreSQL: a dynamic segment stored as a view
CREATE OR REPLACE VIEW seg_recent_clickers AS
SELECT s.id
FROM subscribers s
WHERE s.status = 'subscribed'
AND EXISTS (
SELECT 1
FROM events e
WHERE e.subscriber_id = s.id
AND e.event_type = 'email_click'
AND e.occurred_at >= now() - interval '30 days'
);Every SELECT id FROM seg_recent_clickers re-checks every subscriber against the current subscribers and events tables. Someone who unsubscribed ten minutes ago is already gone. Someone whose last click was 30 days and one minute ago is gone too.
Real ESPs rarely work this way. Evaluating a rule across millions of contacts on every read is expensive, so most tools use one of three strategies:
- Evaluate at use. The segment is computed when you open it, preview it, or send to it. This is the closest to the view above.
- Recompute on a schedule. A background job refreshes membership every few minutes or hours. Reads are fast, but the segment can lag behind the data.
- Update on events. The system re-checks a subscriber when something about them changes, such as a new click or a field update. Time-based conditions are the weak spot here. Nothing "happens" when a click turns 31 days old, so the tool needs a separate sweep to remove that person.
Find out which strategy your tool uses. If it is the second or third, a subscriber can be in a segment for a while after they stop matching the rule.
How a static segment is built
A static segment is a snapshot. You can create one in three ways:
- Import. You upload a CSV, for example the attendees of a webinar exported from another system.
- Manual selection. You tick contacts in a list view.
- Freeze. You run a rule once and save the result as a list.
The freeze is the most useful for this tutorial. You write a dynamic rule, run it, and keep the output. In SQL, that is a table instead of a view.
-- PostgreSQL: a table to hold frozen audiences
CREATE TABLE IF NOT EXISTS segment_snapshots (
segment_name text NOT NULL,
subscriber_id bigint NOT NULL,
captured_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (segment_name, subscriber_id)
);
-- Freeze the current members of the dynamic segment under a name
INSERT INTO segment_snapshots (segment_name, subscriber_id)
SELECT 'webinar_invite_2026_11', id
FROM seg_recent_clickers
ON CONFLICT DO NOTHING;The primary key on (segment_name, subscriber_id) stops the same person being added twice to one snapshot. captured_at records when the snapshot was taken, which you will need when you interpret results later.
After this runs, the list no longer depends on events. Even if every click is deleted tomorrow, the snapshot still holds the same people.
The cost of freezing: drift
A snapshot starts accurate and becomes less accurate every day. This is called drift. You can measure it by comparing the snapshot with what the rule would return now.
-- PostgreSQL: snapshot members who no longer match the rule
SELECT sn.subscriber_id
FROM segment_snapshots sn
LEFT JOIN seg_recent_clickers r ON r.id = sn.subscriber_id
WHERE sn.segment_name = 'webinar_invite_2026_11'
AND r.id IS NULL;The LEFT JOIN ... WHERE r.id IS NULL pattern returns snapshot rows with no match in the live segment. Some of those people have unsubscribed. Others simply stopped clicking. These two groups need different handling, as the next section explains.
Consent does not freeze
A static list records who qualified. It does not record who may still be emailed. A person on a snapshot can withdraw consent, hard-bounce, or be suppressed after the snapshot was taken. The send must check current status regardless of segment type.
-- PostgreSQL: send-time audience from a static snapshot, with a live consent check
SELECT sn.subscriber_id
FROM segment_snapshots sn
JOIN subscribers s ON s.id = sn.subscriber_id
WHERE sn.segment_name = 'webinar_invite_2026_11'
AND s.status = 'subscribed';This keeps the benefit of a stable membership list and still honours the current subscription status. Most ESPs apply this suppression for you, but you should confirm that they do for imported static lists too. Some tools treat an import as a fresh consent claim and need an explicit mapping of the status column.
Failure modes of dynamic segments
The audience moves during a send. A large send can take minutes or hours. If membership is re-evaluated while the send is running, people can enter or leave mid-way. Some receive the message and some do not, with no record of which rule version applied. Most ESPs resolve the audience at the start of a send, but a few re-evaluate in batches. Check this before you send to a segment whose membership changes quickly.
Flapping. A rule on a narrow time window can push people in and out repeatedly. For example, "opened in the last 3 days" will drop a daily-reading subscriber the day they miss two emails and re-add them when they open again. If the segment drives automation (a welcome series, a win-back flow), flapping can trigger the same flow repeatedly. A wider window or a minimum dwell time reduces this.
Boundary effects. A rule such as occurred_at >= now() - interval '30 days' uses a sliding boundary. Two people who clicked 29 days and 31 days ago are treated differently, even though their behaviour is almost the same. This is acceptable for most campaigns. It matters when the segment feeds a report, because the same rule evaluated on different dates gives different counts.
Hidden dependencies. Segments built on other segments change when the inner segment changes. If you edit "active customers", every segment that references it is silently redefined. Keep a record of which segments depend on which.
Stale lag. As noted above, scheduled recomputation means the segment can disagree with the data. The disagreement is bounded by the refresh interval, so look it up.
Failure modes of static segments
Staleness. A list captured three months ago reflects who was interested three months ago. Sending it as if it were current wastes sends on people whose situation has changed.
Silent growth of obligation. Imported lists often arrive without a record of how each person consented. Because the list never re-evaluates, nothing prompts you to check. Store the source and date with the import.
Divergence from the rule. A frozen list of "active customers" is not "active customers". It is "people who were active customers on a given date". If the name does not say so, someone will reuse it as though it were live. Put the capture date or purpose into the name.
No automatic hygiene. Dynamic segments shed people who no longer match. Static segments keep them until you remove them.
When to use which
Use a dynamic segment when the message should follow the subscriber's current state. Lifecycle stages are the clearest case. A subscriber who buys moves from "prospect" to "active customer", and the next lifecycle email should reflect that. Behavioural segments that drive ongoing communication also belong here.
Use a static segment when the audience is defined by a past event or a decision, not by a rule that keeps evaluating. Examples are everyone who attended a specific webinar, everyone who received a specific offer, or a list supplied by a partner.
Use a frozen dynamic rule when you need the audience to be stable and reproducible:
- You are running a test with a holdout group and must keep the two groups fixed. The final chapter relies on this.
- You will report on the campaign and need to know exactly who was targeted.
- A multi-step sequence must keep the same people at every step, even if their behaviour changes between steps.
A worked example
You run a store and plan a launch email for a new running shoe. You want to reach people who clicked in the last 30 days.
- You define
seg_recent_clickersas a dynamic segment, as in the view above. On Monday it has 4,200 members. - You plan to hold back 10% as a control group (covered in the last chapter), so the audience must stay fixed. You freeze it into
segment_snapshotsasrunning_launch_2026_11. - The launch goes out on Tuesday. Between Monday and Tuesday, 60 people unsubscribed. The send-time join against
subscribersexcludes them, so 4,140 receive it. - Two weeks later you run the drift query. It shows that 700 snapshot members no longer match the live rule. That is expected, because the snapshot records who qualified on Monday, not who qualifies now.
- For the follow-up email, you do not reuse the snapshot. The follow-up is a lifecycle message about "active customers", so it uses a dynamic segment that reflects who has bought since the launch.
The same rule served two purposes. It ran live for the first view and was frozen for the test. The follow-up went back to a live rule.
Practical guidance
- Name the segment type in the segment name, for example
dyn_recent_clickersandsnap_running_launch_2026_11. The hygiene chapter covers naming in more depth. - Record the capture date on every static list.
- Check your ESP's documentation for when dynamic segments are refreshed and when a send resolves its audience.
- Apply the consent check at send time for both types.
- Treat lifecycle segments as dynamic by default. The next chapter defines them as rules with mutually exclusive entry conditions, and a frozen version would stop reflecting a subscriber's actual stage.
Exercise
You build a segment of "subscribers who clicked an email in the last 30 days" and send a launch email to it. A month later, a colleague wants to know how many of the people you emailed went on to buy, and they re-run the segment to get the list. What goes wrong, and how would you have avoided it?
Show answer
Re-running a dynamic segment evaluates it against today's data and today's now(), so it returns people who qualify now, not the people who were emailed. Some recipients have dropped out because their clicks aged past 30 days, and new people have entered. The purchase count will be computed on the wrong audience. To avoid this, freeze the audience into a snapshot (for example a row per subscriber in a segment_snapshots table with a name and capture date) when you send, and report against that snapshot. The send should also have applied a live consent check, so you can separately record who was actually delivered to.
Exercise
A static list of 2,000 webinar attendees was imported six months ago. You are asked to send them a product announcement. Name two checks you should make before sending, and say whether converting the list to a dynamic segment would solve them.
Show answer
First, check current consent and suppression status at send time, because people may have unsubscribed or bounced since the import, and confirm how they originally agreed to hear from you. Second, decide whether "attended the webinar six months ago" is still a meaningful reason to target them for this announcement, since interest drifts. Converting to a dynamic segment would not fix either check. A dynamic rule can only re-evaluate conditions that exist in your data. Attendance is a past event, so it would stay true forever, and consent must still be checked separately.