Sub topic 2
Collecting and Honoring Consent
Assume you know basic analytics, tag managers, conversions, funnels, and cookies. Consent is permission for a defined data use. It is not a general license to track someone everywhere.
Collect consent before collection
Separate data uses in your consent management platform (CMP), such as analytics, advertising, personalization, and selling or sharing data. Ask for a clear choice, record the policy version and timestamp, and make withdrawal as easy as acceptance. Do not load nonessential tags before the required consent is granted.
| Data use | Typical control |
|---|---|
| Essential security and checkout | Usually allowed when genuinely necessary |
| Analytics | Often requires consent, depending on jurisdiction and configuration |
| Advertising and personalization | Usually requires consent or an approved legal basis |
A common error is treating a banner click as enough. Your tag manager must enforce the choice. The default state should be denied for uses that require permission.
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
gtag("consent", "default", {
analytics_storage: "denied",
ad_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied"
});
function onConsentGranted() {
gtag("consent", "update", {
analytics_storage: "granted",
ad_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted"
});
}Build a first-party foundation
First-party data is information collected directly by your organization, such as account details, purchases, and consented website events. Store a stable internal customer ID separately from marketing identifiers. Define retention periods, access controls, and deletion workflows.
A first-party cookie can remember a browser, but it does not prove that the same person returned. Keep its purpose narrow and honor consent and browser lifetime limits.
Ask customers directly
Zero-party data is information a customer intentionally provides, such as a stated preference or product need. Ask only useful questions and explain the value exchange. For example, a preference quiz can improve recommendations while giving the customer a better experience. Never disguise optional questions as required account fields.
Use server-side tracking carefully
Server-side tracking sends events from your server to an analytics or advertising endpoint. It can reduce browser loss and protect credentials, but it does not remove consent requirements. Validate event purpose, consent status, and identifiers before forwarding an event. Hashing an email protects its transport format; it does not make the email anonymous.
Exercise
A visitor rejects advertising cookies but completes a purchase. Can the server send the buyer's email to an advertising platform for matching?
Show answer
Only if the visitor has separately consented to that advertising use or another documented lawful basis permits it. A purchase alone does not automatically authorize advertising matching.