Sub topic 1
Why Segment: Matching the Message to the Audience
Prerequisites
Assume you know basic email marketing terms, use an email service provider or CRM, and understand AND, OR, and NOT. The SQL examples assume basic PostgreSQL knowledge.
Why segment: matching the message to the audience
Segmentation divides subscribers into groups based on shared facts or actions. The purpose is not to create as many groups as possible. It is to match a specific message to a group with a relevant need.
For example, a welcome message fits a new subscriber, while a replenishment reminder fits a recent customer. A message about running shoes is more useful to subscribers who repeatedly read running content than to the entire list.
Start with the campaign goal and message. Then define the smallest useful audience that should receive it. A segment should change the message, timing, offer, or call to action.
The data segments are built from
Segments usually use two kinds of data:
- Profile fields, such as subscription status, signup date, location, or last purchase date.
- Events, which record actions such as clicks, purchases, page visits, and email replies.
Behavioural segments use recent actions. Interest segments use repeated actions related to a topic. Lifecycle segments use dates and customer status to describe stages such as new subscriber, active customer, or lapsed customer.
Consent and privacy boundaries
Consent is an eligibility condition, not an optional filter. Exclude unsubscribed contacts and respect preferences such as topic opt-outs, regional rules, and frequency limits. Do not infer sensitive traits when the person did not provide them for that purpose.
Keep only the data needed for the campaign. Record why a person entered a segment and when the rule was evaluated. This makes the segment easier to audit and correct.
Writing segment rules
Express each segment as explicit conditions. Include a time window when behaviour can become stale.
SELECT s.id
FROM subscribers AS s
WHERE s.status = 'subscribed'
AND EXISTS (
SELECT 1
FROM events AS e
WHERE e.subscriber_id = s.id
AND e.event_type = 'email_click'
AND e.occurred_at >= now() - interval '30 days'
);This rule uses AND to require both consent status and a recent click. EXISTS checks whether at least one matching event exists. For stronger evidence of interest, require a minimum count, such as two clicks on the same topic within 60 days.
Exercise
Why should a behavioural rule include a time window?
Show answer
Older actions may no longer represent the subscriber's current interest or intent.