Sub topic 9
Segmenting by lifecycle stage
This chapter assumes you know basic SQL, boolean logic, and the segment rules and static-versus-dynamic distinction from earlier chapters. Examples use PostgreSQL, but the ideas carry over to any email service provider (ESP) that supports rule-based segments.
What a lifecycle stage is
A lifecycle stage describes where a person is in their relationship with you: new, buying, lapsed, or never converted. Behaviour segments describe what someone did recently. Interest segments describe what they care about. A lifecycle stage describes their overall status, so it changes slowly and suits messages like onboarding, replenishment, and win-back.
Two rules make lifecycle segments work:
- Mutually exclusive. Each subscriber is in exactly one stage at a time. If stages overlap, a person can receive a welcome email and a win-back email in the same week.
- Clear entry rules. Each stage has a written condition based on stored data, such as dates of signup and last purchase. Avoid conditions like "seems engaged".
Lifecycle segments should be dynamic. A subscriber who buys today must leave "prospect" automatically, and a static list would keep them there until someone rebuilt it.
Choose the data first
You need only two date fields on the subscriber profile to define a basic set of stages:
| Field | Meaning | Used for |
|---|---|---|
| `created_at` | When the person subscribed | Detecting new subscribers |
| `last_purchase_at` | Date of most recent order, or NULL if none | Separating customers from prospects, and active from lapsed |
| `status` | Consent state | Excluding anyone who is not subscribed |
The thresholds (14 days for "new", 90 days for "active") are business choices. Base them on your normal purchase cycle. A shop selling running shoes might use 90 days, while a grocery delivery service might use 21.
Define stages with CASE
In SQL, a CASE expression checks its branches from top to bottom and returns the first match. That behaviour gives you mutual exclusivity for free, provided you order the branches from most to least specific.
-- PostgreSQL: assign each subscribed contact exactly one lifecycle stage
SELECT id,
CASE
WHEN last_purchase_at >= now() - interval '90 days' THEN 'active_customer'
WHEN last_purchase_at IS NOT NULL THEN 'lapsed_customer'
WHEN created_at >= now() - interval '14 days' THEN 'new_subscriber'
ELSE 'prospect'
END AS lifecycle_stage
FROM subscribers
WHERE status = 'subscribed';Read the branches in order:
- A purchase in the last 90 days makes someone an
active_customer. - Any earlier purchase makes them a
lapsed_customer. By this point the first branch has already failed, so the purchase must be older than 90 days. - No purchase and a recent signup makes them a
new_subscriber. - Everyone else is a
prospect: subscribed for a while, never bought.
The WHERE status = 'subscribed' filter keeps unsubscribed and suppressed contacts out of every stage.
Common errors
- Wrong branch order. If the "new subscriber" check came first, a person who signed up and bought within 14 days would be labelled new, not active. Decide which stage should win and put it first.
- Forgetting NULL.
last_purchase_at >= ...is never true when the value is NULL, so such rows fall through. TheIS NOT NULLcheck in branch two and theELSEbranch handle this on purpose. Test your rules with NULL values. - Stale data. If purchases are written to the profile hours late, people sit in the wrong stage. Check how often your ESP syncs order data.
- Gaps and overlaps in ESP rules. Visual rule builders often have no
CASE. You then write each stage as its own segment, and you must add exclusions by hand (for example, "prospect" requires no purchase AND signup older than 14 days).
Match messages to stages
Each stage has a different job:
| Stage | Typical goal | Example message |
|---|---|---|
| `new_subscriber` | Set expectations | Welcome and preference choices |
| `prospect` | First purchase | Social proof, first-order offer |
| `active_customer` | Repeat purchase | Related products, loyalty perks |
| `lapsed_customer` | Win back | Reminder, "what's new", limited offer |
Check segment sizes before you build campaigns. A stage with only a few dozen people may be too small to test on. The next chapter combines lifecycle with other dimensions, and that makes the groups smaller, so you should know your baseline sizes first.
Exercise
A subscriber signed up 5 days ago and placed an order yesterday. Using the CASE expression in this chapter, which stage do they get, and why? What would change if you moved the new_subscriber branch to the top?
Show answer
They are an active_customer, because their last_purchase_at is within 90 days and that branch is checked first. If new_subscriber came first, they would be labelled new_subscriber instead, because signup within 14 days would match before the purchase check. (Note the original ordering also needs last_purchase_at IS NULL in that branch to avoid mislabelling in the reverse case, since a moved branch would otherwise capture all recent signups, buyers included.)
Exercise
Why should lifecycle segments usually be dynamic rather than static?
Show answer
Lifecycle stage depends on dates and purchases that change over time. A dynamic segment re-evaluates its rule, so people move between stages automatically. A static list would keep people in the stage they had when it was built.