Sub topic 6
Consent, purposes and preference management
This chapter covers how to record what a customer agreed to, for which purpose, and when. It assumes you know what first-party and zero-party data are, you have a basic idea of what a cookie is, and you have seen a CRM or email platform. You do not need legal training. This is a working model for marketers, not legal advice. Check your rules with your privacy or legal team.
Why consent is a data problem, not just a banner
Many teams treat consent as a pop-up on the website. In practice, consent is a piece of data you store, read and enforce. If a customer says "yes to email, no to ads," that answer has to reach every system that sends email or builds ad audiences.
A consent program has three parts:
- Consent: the customer's permission for a specific use of their data.
- Purpose: the reason you want the data, such as personalization or email marketing.
- Preference: a choice about how you contact them, such as frequency, channel or topics.
Consent and preference are related but different. Consent is about whether you may use data for a purpose. Preference is about what the customer would like within what you may do. A customer can consent to email marketing and still prefer one email a week about running shoes only.
The working model: purpose-based consent
Good consent is tied to a purpose. A single "I agree to everything" checkbox is hard to defend and hard to use. Many privacy laws, such as the GDPR in the EU, expect consent to be specific, informed and freely given. Customers must also be able to withdraw it as easily as they gave it.
Typical purposes in marketing:
| Purpose | Example use | Typical data |
|---|---|---|
| Email marketing | Promotional newsletters | Email address, preferences |
| Personalization | Tailored website content | Browsing history, stated interests |
| Advertising | Custom audiences on ad platforms | Hashed email, purchase history |
| Analytics | Measuring site performance | Page views, device data |
| Service messages | Order and delivery updates | Email, phone, order data |
Service messages often rest on a different legal basis, such as performing a contract, and not on consent. Your legal team decides which basis applies to each purpose. Keep this in mind so you do not ask for consent where it is not the right tool, or assume it covers things it does not.
Opt-in and opt-out
Rules differ by region. Some places require opt-in (the customer must act to say yes) for most marketing uses. Others allow opt-out (you may proceed until the customer says no) for some uses. Because your customers may live in many regions, many teams apply the strictest rule they face everywhere. That is simpler than building different logic per region, though it may collect fewer permissions.
What a consent record must contain
A consent record answers four questions: who, what for, what answer, and when. It should also show how the answer was collected, because you may need to prove it later.
The record from the topic's example does this:
{
"customer_id": "c_123",
"field": "preferred_category",
"value": "trail_running",
"data_type": "zero_party",
"collected_via": "preference_center",
"consent_purpose": "personalization",
"consent_status": "granted",
"collected_at": "2026-03-04T10:15:00Z"
}Each field has a job:
customer_idlinks the record to a person.fieldandvaluehold what the customer told you.data_typemarks it as zero-party, which tells you how much to trust it.collected_viashows the capture method, which is your evidence.consent_purposelimits what you may do with it.consent_statusrecords the current answer.collected_atis the timestamp, in UTC, so you know when it was given.
In production you would usually keep more, such as the version of the privacy notice the customer saw and the wording of the checkbox. If the notice changes, you need to know which customers agreed to which wording.
Keep history, not just the latest state
Do not overwrite a consent record when a customer changes their mind. Add a new record and keep the old one. The current status is the latest record for each customer and purpose. The history lets you answer "what did we know on that date?" if a regulator or customer asks.
A simple table design stores one row per consent event:
CREATE TABLE consents (
consent_id BIGINT PRIMARY KEY,
customer_id VARCHAR(40) NOT NULL,
purpose VARCHAR(40) NOT NULL,
status VARCHAR(10) NOT NULL, -- 'granted' or 'withdrawn'
source VARCHAR(40) NOT NULL, -- e.g. 'preference_center'
notice_version VARCHAR(20),
recorded_at TIMESTAMP NOT NULL
);Note that the segment query later in this chapter reads a status of granted per purpose. If you store history, that query must read only the latest row for each customer and purpose. The sketch below shows one way to build that view.
CREATE VIEW current_consents AS
SELECT customer_id, purpose, status, recorded_at
FROM (
SELECT c.*,
ROW_NUMBER() OVER (
PARTITION BY customer_id, purpose
ORDER BY recorded_at DESC
) AS rn
FROM consents AS c
) AS ranked
WHERE rn = 1;The consent lifecycle
Consent is not a one-time event. It moves through states, and your systems must follow it.
Two states are easy to confuse. No choice means you never asked or the customer never answered. Declined means they were asked and said no. Treat both as "do not use," but keep them separate. Otherwise you may ask a customer again and again who already declined, which damages trust.
Where consent is captured
Consent can be collected in several places. Each one needs the same purpose language and writes to the same record.
- Website banner or modal. Handles cookies and tracking. This is usually run by a consent management platform (CMP), a tool that shows the banner, stores the choice and tells other scripts what is allowed.
- Sign-up and checkout forms. Use separate, unticked checkboxes for each marketing purpose. A pre-ticked box is not valid consent in many regions.
- Preference center. A page where customers view and change their choices at any time. It is also a natural place to collect zero-party data, which later chapters cover.
- App settings and in-app prompts. Mobile operating systems also enforce their own permission prompts, such as tracking and push notifications. Your own record must stay in step with them.
- In store or by phone. Staff record the answer in the point-of-sale system or CRM. Wording and evidence still matter.
The preference center deserves attention. A good one shows current choices, lets people change each purpose on its own, and takes effect quickly. An unsubscribe link that leads to a page with one button "Unsubscribe from everything" loses customers who only wanted fewer emails. Offering topic and frequency options often keeps them subscribed.
Enforcing consent downstream
Capturing consent is half the work. The other half is making every system obey it. Consent should be checked at the moment of use, not only at the moment of collection.
The segment query from this tutorial's plan enforces consent by construction. It joins customers to consents and only returns people who granted the purpose:
SELECT c.customer_id, c.email
FROM customers AS c
JOIN consents AS k
ON k.customer_id = c.customer_id
WHERE k.purpose = 'email_marketing'
AND k.status = 'granted'
AND c.preferred_category = 'trail_running';This works when consents holds one current row per customer and purpose. If it holds the full history, as in the table above, point the join at the current_consents view instead. Otherwise a customer who withdrew last week still has an old "granted" row and would be included.
Withdrawal must propagate
When a customer withdraws, the change has to reach every connected tool. Common failure points:
- An email list exported last month and still used for a campaign.
- An ad audience uploaded to a platform and never refreshed.
- A data warehouse copy that updates nightly while the email tool sends within the hour.
Set a target for how fast withdrawals take effect, and test it. Also schedule audience refreshes so old uploads are removed or replaced.
Common errors
- Bundled consent. One checkbox covering email, ads and data sharing. Split it by purpose.
- Missing timestamps or sources. You cannot prove what was agreed. Store both on every record.
- Overwriting history. You lose the ability to answer past questions.
- Treating silence as consent. No choice is not a yes.
- Banner and backend out of sync. The banner says "rejected," but tags still fire because the CMP is not wired to them. Test with real cookies and network requests, not only by looking at the banner.
- Different identifiers across systems. Consent is stored against an email address in one tool and a customer ID in another, so a withdrawal never matches. Identity resolution, covered in a later chapter, addresses this.
- Asking too early or too much. Requesting every permission on the first visit lowers opt-in rates. Ask when the value is clear.
Measuring the consent flow
Later chapters cover measurement in full. For now, track two basics for each purpose:
- Consent rate: customers who granted the purpose divided by customers who were asked.
- Withdrawal rate: customers who withdrew divided by customers who had granted, over a period.
A rising withdrawal rate often signals that messages are too frequent or not relevant. Low consent rates often point to unclear wording or poor timing.
Exercise
A customer granted email marketing consent in January, withdrew in March, and your segment query still returns them. The consents table stores one row per consent event. What is the most likely cause, and how do you fix it?
Show answer
The query reads every row, so the old "granted" row from January still matches. Fix it by reading only the latest row for each customer and purpose, for example through a current_consents view that uses ROWNUMBER() ordered by recordedat descending and keeps rank 1. Also check that any previously exported lists or ad audiences are refreshed.
Exercise
Your sign-up form has one pre-ticked box that reads "I agree to receive offers and to let partners use my data." Name three problems and describe a better design.
Show answer
The box is pre-ticked, so it is not an active choice. It bundles email marketing and data sharing into one purpose. It also gives no way to record which purpose was agreed. A better design uses separate unticked checkboxes, one per purpose, with plain wording, and stores a record per purpose with the status, source and timestamp.
Exercise
A customer in your records has no consent row for advertising. Can you include them in an ad audience? Explain the difference from a customer who declined.
Show answer
No. No choice means you never obtained permission, so you must not use their data for advertising. A customer who declined was asked and said no. Both are excluded, but keeping them as separate states lets you avoid asking the second group again too soon.