Sub topic 12
Using consented data for segmentation and personalization
This chapter covers activation: using the data you have collected to build audiences and tailor messages. It assumes you know basic segmentation, can read simple SQL, and have seen the consent and purpose model from the earlier chapters. You should also know that a CRM, CDP or warehouse holds the customer profile.
Activation is where consent gets tested
Collection and storage can look compliant while the real risk sits in activation. A customer who granted consent for order updates has not agreed to retargeting ads. A preference stated in a quiz is not permission to email. Each time you build a segment or choose content, you decide whether a specific use of data matches the purpose the customer agreed to.
The practical rule is to make consent part of the segment definition instead of a manual check before sending. Then a segment cannot include a person who has not agreed to the use.
Three kinds of segmentation inputs
Different data types support different segments, and the type affects how much you can trust the signal.
| Input | Example | Strength | Weakness |
|---|---|---|---|
| Zero-party | Stated category preference, size, gift occasion | Explicit and accurate at the time given | Can go stale; covers only people who answered |
| First-party behavioral | Pages viewed, purchases, email clicks | Available for many customers | Needs interpretation; a view is not always interest |
| Derived or modeled | Predicted churn risk, lifetime value tier | Scales to everyone | Can be wrong; may need its own consent basis |
Treat stated preferences as the strongest signal for what to show, and behavior as the signal for when and how often. If a customer says they like trail running but only browses road shoes, do not overwrite the stated value. Store the inferred interest in a separate field so you can compare the two later.
Building a consent-aware segment
Consent records change over time. A customer may grant consent in March and withdraw it in June. If your consent table keeps history, joining on status = 'granted' alone can match the old row after a withdrawal. You need the latest record for each customer and purpose.
The query below takes the most recent consent row per customer for email marketing, then keeps only customers whose latest status is granted and who stated a category preference.
WITH latest_consent AS (
SELECT
customer_id,
purpose,
status,
ROW_NUMBER() OVER (
PARTITION BY customer_id, purpose
ORDER BY recorded_at DESC
) AS rn
FROM consents
)
SELECT c.customer_id, c.email
FROM customers AS c
JOIN latest_consent AS k
ON k.customer_id = c.customer_id
WHERE k.rn = 1
AND k.purpose = 'email_marketing'
AND k.status = 'granted'
AND c.preferred_category = 'trail_running';If your consent table stores one current row per customer and purpose, the simpler join from the earlier example is enough. Check which design you have before choosing.
Some points about this pattern:
- The purpose is part of the filter. A different purpose, such as
ad_targeting, needs its own query or a parameter. - A customer with no consent row is excluded. Missing consent means no consent, so the segment should be an allow-list rather than a block-list.
- Put this logic in a shared view or CDP audience definition. If each analyst rewrites the join, someone will eventually forget it.
Suppression is the other half
Beyond consent, build suppressions that apply across all segments: unsubscribed addresses, people who contacted support with an open complaint, recent purchasers of the promoted product, and customers who asked for fewer messages. Apply these last, so they override any rule that includes the customer.
From segments to personalization
Segmentation puts people into groups. Personalization changes what an individual sees. Both can use the same data, but they have different risks.
Levels of personalization
- Segment-level. Everyone in "trail running, consented" gets the same trail-running email. It is simple to explain and easy to test.
- Rule-based individual. Content depends on fields such as first name, last category viewed, or loyalty tier. Rules are readable, and you can say why a person saw something.
- Model-driven. A recommender or propensity model picks content. It is more flexible, harder to explain, and depends on the quality and consent status of its training data.
Start at the lowest level that works. A preference-driven segment often delivers most of the benefit of a complex model, and it is far easier to audit.
A small rule-based example
The function below chooses a hero banner. It uses a stated preference only when personalization consent is granted. Otherwise it falls back to a generic banner.
from datetime import datetime, timezone
DEFAULT_BANNER = "new_arrivals"
BANNERS = {
"trail_running": "trail_running_sale",
"cycling": "cycling_bundle",
}
def choose_banner(profile: dict) -> str:
consent = profile.get("consents", {}).get("personalization", {})
if consent.get("status") != "granted":
return DEFAULT_BANNER
preference = profile.get("preferred_category")
return BANNERS.get(preference, DEFAULT_BANNER)
profile = {
"customer_id": "c_123",
"preferred_category": "trail_running",
"consents": {
"personalization": {
"status": "granted",
"recorded_at": datetime(2026, 3, 4, 10, 15, tzinfo=timezone.utc),
}
},
}
print(choose_banner(profile))
print(choose_banner({"customer_id": "c_999"}))The first call prints trail_running_sale. The second prints new_arrivals, because the profile has no consent record. The fallback matters as much as the personalized path, since many visitors are anonymous or have not opted in.
Using zero-party data well
Customers give zero-party data expecting something in return. Use it visibly and quickly.
- Reflect it back. If a customer picked "running shoes for wide feet" in a quiz, the next email or page should show that. A stated preference that changes nothing teaches customers that answering is pointless.
- Respect its scope. A preference given in a gift-finder quiz may describe one occasion, not a lasting interest. Store the context, such as
collected_viaandcollected_at, and avoid treating it as permanent. - Let people correct it. Link to the preference center from emails. Customers whose circumstances change will otherwise ignore you or unsubscribe.
- Expire it. Set a review age, for example 12 months, after which the value is treated as unconfirmed and you ask again or lean on recent behavior.
Common errors
Matching on stale consent. Joining on any granted row, without checking for a later withdrawal, is the most common bug. Test it by creating a customer who granted and then withdrew, and confirm they are excluded.
Reusing data across purposes. Email addresses collected for receipts end up in an ad audience upload. Check the purpose for every destination, not only the source.
Sending hashed data to ad platforms without a basis. Hashing an email does not remove the need for consent to use it for advertising. Treat hashed identifiers as personal data.
Over-personalizing. Content that reveals what you inferred, such as a health-related product suggestion, can feel invasive even when it is allowed. Prefer personalization based on what the customer told you over inferences they did not expect.
Sparse segments. Stacking many conditions can leave a few hundred people, which makes testing noisy. Check segment size before launch, and keep a broader fallback.
Letting data go stale in destinations. Syncing audiences to an email tool or ad platform once, without refreshing, means a withdrawal in your system does not reach the tool. Schedule syncs, and make withdrawals propagate quickly.
Checking that activation works
Before launching a segment, run a short checklist:
- Does the definition filter on purpose and the latest consent status?
- Are suppressions applied after inclusion rules?
- Is the segment large enough to measure?
- What does a customer outside the segment see?
- How quickly does a withdrawal remove someone from every destination?
Keep a holdout group, a random portion of eligible customers who receive the default experience. Comparing them with the personalized group is how you later measure incremental lift, covered in a later chapter.
Exercise
A customer granted email marketing consent in March and withdrew it in June. Your consents table keeps every change as a new row. The query joins customers to consents with WHERE purpose = 'email_marketing' AND status = 'granted'. Will this customer appear in the segment, and how do you fix it?
Show answer
Yes, the customer will appear, because the March row still has status 'granted'. Fix it by selecting only the most recent row per customer and purpose, for example with ROWNUMBER() OVER (PARTITION BY customerid, purpose ORDER BY recorded_at DESC), keeping rn = 1, and then filtering on status = 'granted'. Test with a customer who granted and then withdrew.
Exercise
A quiz respondent said they want trail running content, but they gave consent only for order updates. Can you add them to a trail running promotional email segment? What would you do instead?
Show answer
No. The stated preference does not grant permission to send marketing email, because consent is tied to purpose. Exclude them from the promotional segment. You can show trail running content in contexts covered by a purpose they agreed to, such as an on-site experience if personalization consent exists, or invite them to opt in to email with a clear explanation of the benefit.