Sub topic 5
Defining an Engaged Subscriber
Every later step in a sunset policy depends on one decision: what counts as "engaged". If the definition is too loose, dead addresses stay on your list. If it is too strict, you suppress people who still read your mail. This chapter builds a definition you can express in a query and defend to colleagues.
This chapter assumes you know basic email marketing terms (list, campaign, bounce, unsubscribe), how mail goes out through an email service provider (ESP), and enough SQL to read a join with an aggregate. Choosing the length of the inactivity window comes in the next chapter, so here it appears only as a parameter.
What "engaged" means for deliverability
For sunsetting, an engaged subscriber is one who has recently done something that shows a real person received your mail and chose to act on it. The definition has three parts:
- A qualifying action. An event type you trust as evidence of human interest.
- A lookback window. How recent that action must be.
- A reference point. What to use for people who have never acted.
You are not trying to measure how much someone likes your brand. You are trying to estimate whether mailbox providers will see positive or negative reactions when you send to this person. A subscriber who reads every issue but never clicks looks, from your data, identical to one who ignores you. Accept that some false positives (people flagged inactive who are actually reading) are the price of using signals you can measure. The re-engagement campaign in a later chapter exists partly to recover those people.
Ranking the signals you can collect
Not every event is equal. Rank them by how hard they are to fake and how clearly they show intent.
| Signal | Strength | Main failure mode |
|---|---|---|
| Purchase or conversion | Very strong | Absent for non-commerce lists |
| Reply to a message | Very strong | Rare, and auto-replies must be excluded |
| Click on a link | Strong | Security scanners and link prefetchers generate false clicks |
| Site, app, or account activity tied to the address | Strong | Needs identity matching across systems |
| Preference center visit or update | Moderate to strong | Infrequent |
| Open | Weak | Privacy proxies and image prefetching create opens without a human |
| Delivered with no bounce | Not engagement | Proves only that the mailbox exists |
The open is the signal most ESP dashboards put first, and it is the least reliable. Apple Mail Privacy Protection can fetch images for every message on the recipient's behalf, so an open appears whether or not the person looked. Some corporate gateways and image proxies do the same. A subscriber who has not touched your mail in two years can show an "open" yesterday.
That does not make opens useless. They are noisy evidence that you can use carefully (see below), but they should not be the only thing that keeps an address on your list.
Handling bot clicks
Clicks are stronger than opens but not clean. Security tools open every link in an incoming message to check for malware. These scanners often click all links within a second or two of delivery, and often from data-center IP addresses.
Common heuristics for flagging suspected bot clicks:
- The click happens within a few seconds of delivery.
- A single recipient clicks several different links in the same message within the same second.
- The user agent or IP range matches a known scanner.
- A single address shows a click on every message ever sent, always at the same delay.
Many ESPs flag some of these for you. If yours does, store the flag. If it does not, compute a conservative one yourself and keep it as a column so you can adjust it later. The query below assumes a boolean is_suspected_bot on each event.
A working schema
The examples in this chapter use two PostgreSQL tables. Adapt the names to your system.
CREATE TABLE subscribers (
id bigint PRIMARY KEY,
email text NOT NULL,
status text NOT NULL, -- 'subscribed', 'unsubscribed', 'suppressed'
subscribed_at timestamptz NOT NULL
);
CREATE TABLE engagement_events (
id bigserial PRIMARY KEY,
subscriber_id bigint NOT NULL REFERENCES subscribers (id),
event_type text NOT NULL, -- 'open', 'click', 'purchase', 'reply', ...
occurred_at timestamptz NOT NULL,
is_suspected_bot boolean NOT NULL DEFAULT false
);
CREATE INDEX engagement_events_subscriber_time
ON engagement_events (subscriber_id, occurred_at DESC);The index matters. The sunset query scans every subscriber's events, and without it the job slows sharply as the event table grows.
The core definition as a query
This query finds subscribed addresses that joined more than 180 days ago and have no click or purchase in the last 180 days. It uses clicks and purchases instead of opens.
SELECT s.id,
s.email,
MAX(e.occurred_at) AS last_engaged_at
FROM subscribers s
LEFT JOIN engagement_events e
ON e.subscriber_id = s.id
AND e.event_type IN ('click', 'purchase')
WHERE s.status = 'subscribed'
AND s.subscribed_at < now() - interval '180 days'
GROUP BY s.id, s.email
HAVING MAX(e.occurred_at) IS NULL
OR MAX(e.occurred_at) < now() - interval '180 days';Three details are worth understanding:
- The
LEFT JOINkeeps people with no events. An inner join would drop exactly the subscribers you most need to find. - The event filter sits in the
ONclause, not inWHERE. Puttinge.event_type IN (...)inWHEREwould turn the join back into an inner join and silently remove never-engaged people. subscribed_at < now() - interval '180 days'protects new subscribers. Someone who joined last week has had no chance to engage. The window is a placeholder here and is the subject of the next chapter.
Adding tiers and a bot filter
A yes-or-no flag hides useful information. A tiered view lets you see how your list is distributed before you act on it. This version excludes suspected bot events and counts activity in two periods.
SELECT s.id,
s.email,
s.subscribed_at,
MAX(e.occurred_at) AS last_engaged_at,
COUNT(e.id) FILTER (WHERE e.occurred_at >= now() - interval '90 days') AS events_90d,
COUNT(e.id) FILTER (WHERE e.occurred_at >= now() - interval '180 days') AS events_180d,
CASE
WHEN COUNT(e.id) FILTER (WHERE e.occurred_at >= now() - interval '90 days') > 0
THEN 'engaged'
WHEN COUNT(e.id) FILTER (WHERE e.occurred_at >= now() - interval '180 days') > 0
THEN 'cooling'
WHEN s.subscribed_at >= now() - interval '180 days'
THEN 'new'
ELSE 'inactive'
END AS tier
FROM subscribers s
LEFT JOIN engagement_events e
ON e.subscriber_id = s.id
AND e.event_type IN ('click', 'purchase', 'reply')
AND NOT e.is_suspected_bot
WHERE s.status = 'subscribed'
GROUP BY s.id, s.email, s.subscribed_at;The cooling tier is useful. These subscribers have engaged within 180 days but not 90. You can send them a lighter touch, such as a sharper subject line or a preference prompt, before they reach inactive.
Using opens carefully
You can still use opens as a secondary signal. Two patterns are reasonable:
- Opens as a tiebreaker for a warning list. Subscribers with no clicks but recent opens go into a "watch" group that receives the re-engagement message later or less aggressively than the no-open group.
- Opens filtered by client. If your ESP reports the mail client, ignore opens from privacy proxies when they are identifiable, and count only opens from clients that do not prefetch.
Do not let an open alone reset a subscriber's clock. Treat it as a reason to be gentler, not as proof of engagement.
Choosing signals for your type of list
The right set depends on what your mail asks people to do.
| List type | Suggested qualifying actions |
|---|---|
| Online store | Purchase, click, account login |
| Content newsletter | Click, reply, site visit with identified session |
| Software product updates | Click, product login, support interaction |
| Event or community list | Click, registration, attendance, reply |
If your content is meant to be read in the message itself, such as a short plain-text letter, clicks will undercount real readers. In that case add a non-email signal, such as a reply or a visit from a personalized link, or give readers a one-click "still interested" link in the footer. Do not fall back to opens.
Edge cases to decide up front
Write these answers into your definition before you build anything.
- Never-engaged subscribers. Use
subscribed_atas the reference point, as thenewtier above does. Otherwise aNULLlast-engaged date will either exclude them or flag them on day one. - Resubscribers. If someone unsubscribes and comes back, decide whether old events count. Usually the new
subscribed_atshould win, and events before it should be ignored. - Data retention. If you purge event data after 12 months, you cannot evaluate a 24-month window. The window cannot be longer than the history you keep.
- Several lists or brands. Decide whether engagement on one list counts for another. If mailbox providers see them as one sending domain, a shared definition is usually safer.
- Tracking gaps. If you changed ESPs or turned off click tracking for some campaigns, those periods will look like silence. Exclude campaigns without tracking from the calculation.
- Time zones. Store timestamps in UTC and compare against UTC
now(). A window measured in local dates can shift by a day. - Transactional mail. Receipts and password resets are not marketing sends, and opens on them are not marketing engagement. Keep them out of the events table or tag them so you can exclude them.
How the pieces fit
The output of this classification feeds the re-engagement campaign. It does not suppress anyone on its own.
Common errors
- Counting delivery as engagement. A message that did not bounce says only that the mailbox exists.
- Moving the filter into
WHERE. This drops never-engaged subscribers and makes your inactive count look too small. - Trusting raw clicks. Scanner clicks make dead addresses look alive. Check the time between delivery and click.
- Defining engagement once and never checking it. Compare your inactive count against complaint and bounce data. If the inactive group is not over-represented in bounces, spam-trap hits, or complaints, your definition may not be capturing the risk.
- Using different definitions in different tools. Keep the definition in one place, such as a SQL view, so the dashboard, the automation, and the audit all agree.
Exercise
A colleague proposes defining an engaged subscriber as "opened any email in the last 90 days." Name two problems with this definition and say what you would change.
Show answer
First, privacy proxies and image prefetching, such as Apple Mail Privacy Protection, generate opens with no human reading, so people who ignore your mail appear engaged and the policy removes few addresses. Second, opens give no signal for plain-text readers or for clients that block images, so some real readers look inactive. Change the qualifying actions to clicks, purchases, and replies, filter suspected bot clicks, and use opens only as a secondary signal that lowers the urgency for a subscriber, not one that resets the clock.
Exercise
In the core query, what happens if you move AND e.event_type IN ('click', 'purchase') from the ON clause into the WHERE clause, and why?
Show answer
The query stops returning subscribers who have no click or purchase events. With a LEFT JOIN, those subscribers produce rows where e.event_type is NULL, and a WHERE condition on e.event_type rejects NULL rows. This effectively converts the LEFT JOIN into an inner join and hides the never-engaged subscribers you most need to find.