Sub topic 4
Privacy law basics: GDPR, ePrivacy and US state laws
This chapter assumes you know what a cookie is, how a tag manager fires tags, and the basics of campaigns, conversions and funnels. It explains the legal rules that shape which tracking signals you may collect. It is a working guide for marketers, not legal advice. Have counsel review decisions that carry real risk.
Why law matters for tracking
Browser restrictions remove signals technically. Privacy law removes them by permission. A tag that still works in the browser may be unlawful to fire without consent. So you need both views when you plan targeting and measurement.
Three terms come up in every privacy law:
- Personal data is any information that relates to an identifiable person. Under GDPR this includes cookie IDs, device IDs, IP addresses and hashed emails, not only names.
- A controller decides why and how personal data is used. A processor handles data on the controller's behalf. An advertiser running its own site is usually a controller.
- Processing is almost anything done with the data: collecting, storing, matching, sending to an ad platform.
GDPR
The General Data Protection Regulation (GDPR) is the European Union's data protection law. It also applies in the European Economic Area, and the UK has a close equivalent. It applies if you offer goods or services to people in the EU, or monitor their behavior, even when your company is based elsewhere.
Lawful basis
GDPR requires a lawful basis for each purpose you process personal data for. Two matter most in marketing:
| Basis | What it means | Typical marketing use |
|---|---|---|
| Consent | A clear, voluntary opt-in for a stated purpose | Advertising cookies, cross-site tracking, personalized ads |
| Legitimate interests | You have a genuine business reason, you have weighed it against the person's rights, and they can object | Some first-party analytics, fraud prevention, limited direct marketing to customers |
Legitimate interests is not a loophole. You must document a balancing test, and it does not override the ePrivacy rules below when you store or read data on a device.
What valid consent looks like
GDPR sets a high bar for consent. It must be:
- Freely given. Access to the service cannot depend on consenting to unneeded tracking.
- Specific. Each purpose, such as analytics or ad personalization, is a separate choice.
- Informed. The person knows who the controller is and what the data will be used for.
- Unambiguous. A pre-ticked box or continued scrolling does not count.
- Withdrawable. Withdrawing must be as easy as giving consent.
Regulators have also criticized banners where "Accept all" is one click and "Reject" is buried in a second layer. Treat accept and reject as equally easy.
Other GDPR duties that affect marketers
- Data minimization: collect only what the stated purpose needs.
- Purpose limitation: you cannot reuse data for a new, incompatible purpose.
- Rights of access, deletion and objection. People can ask what you hold, ask you to erase it, and object to direct marketing at any time.
- Records and contracts: you need a data processing agreement with vendors that process data for you, and you should keep records of consent.
- Transfers: sending EU personal data to countries without an adequacy decision needs a legal transfer mechanism. This affects which analytics and ad vendors you can use.
- Penalties: fines can reach 4% of worldwide annual turnover or 20 million euros, whichever is higher, for the most serious breaches.
ePrivacy
The ePrivacy Directive is a separate EU rule, often called the "cookie law". It is implemented through national laws, so details differ by country. Its key rule applies to the device, not to the data: storing information on a person's device, or reading it, needs consent unless it is strictly necessary to deliver a service the person requested.
This covers cookies, local storage, device fingerprinting and tracking pixels that read device data. Two consequences follow:
- Consent is required before a tracking cookie is set, not after. A banner that fires tags first and asks later does not comply.
- Moving tracking from a third-party cookie to a first-party cookie does not remove the consent requirement. The rule looks at the purpose, not the cookie's domain.
Strictly necessary items, such as a shopping cart cookie or a login session, are exempt. Analytics and advertising are generally not treated as strictly necessary. Some national regulators allow limited, privacy-friendly analytics without consent, but this varies by country, so check each market.
The ePrivacy rules are under long-running reform, so check current national guidance rather than relying on this chapter's summary.
US state laws
The US has no single federal privacy law for general marketing. Instead, a growing number of states have passed comprehensive laws. California was first with the CCPA, later amended by the CPRA. Many other states, including Virginia, Colorado, Connecticut and Texas, have followed, and the list keeps changing. Verify the current list and effective dates before you rely on it.
The opt-out model
Most US state laws work differently from GDPR. Instead of requiring opt-in consent before collection, they generally let you collect data and require you to offer an opt-out of certain uses. The uses that matter most for marketing are:
- Sale of personal data, which is broadly defined and can include sharing data with ad partners in return for something of value.
- Sharing or processing for targeted (cross-context behavioral) advertising.
- Profiling in some cases.
Sensitive data, such as precise location, health information and data about children, usually needs opt-in consent even in the US.
Universal opt-out signals
Several states require businesses to honor a browser-level opt-out signal. Global Privacy Control (GPC) is the main one. When a visitor's browser sends GPC, you must treat it as an opt-out of sale and targeted advertising for that browser. Your consent tooling should detect the signal automatically.
Other common requirements
- A privacy notice that describes what you collect and why.
- A visible "Do Not Sell or Share My Personal Information" link or equivalent where the law requires it.
- Rights to access, delete and correct data.
- Contracts with vendors that restrict how they use the data.
- Data protection assessments for higher-risk processing such as targeted advertising, in several states.
GDPR compared with US state laws
| Question | GDPR and ePrivacy (EU) | Typical US state law |
|---|---|---|
| Default for ad tracking | Opt-in consent first | Allowed, with opt-out |
| Applies to | Any personal data, including online IDs | Personal data of residents, often above size or revenue thresholds |
| Browser signal | Not a consent mechanism by itself | GPC often must be honored as an opt-out |
| Sensitive data | Special rules, usually explicit consent | Usually opt-in consent |
| Enforcement | Data protection authorities, large fines | State attorneys general, and a limited private right of action in California for data breaches |
How the rules flow into your stack
The law decides whether a signal may exist. Your consent system then has to pass that decision to every tag.
A simple way to apply this in code is to compute the rule once and have every tag read it. The example below is a sketch of the decision, not a complete consent platform.
// Decide whether advertising tags may run for this visitor.
// region: "EU", "UK" or "US"; consent is true, false or null (no choice yet).
function advertisingAllowed({ region, consent, gpcSignal }) {
if (region === "EU" || region === "UK") {
return consent === true; // opt-in required: no choice means no tracking
}
if (region === "US") {
if (gpcSignal === true) return false; // honor the opt-out signal
return consent !== false; // allowed unless the visitor opted out
}
return consent === true; // unknown region: take the stricter path
}
console.log(advertisingAllowed({ region: "EU", consent: null, gpcSignal: false })); // false
console.log(advertisingAllowed({ region: "US", consent: null, gpcSignal: true })); // false
console.log(advertisingAllowed({ region: "US", consent: null, gpcSignal: false })); // trueIn a browser, you can read the GPC signal with navigator.globalPrivacyControl.
Common errors
- Firing tags before consent. Tag managers often load all tags on page view. Configure triggers so that advertising tags wait for the consent state.
- Treating a first-party cookie as exempt. Consent depends on purpose, so a first-party advertising ID still needs it in the EU.
- Assuming hashing makes data anonymous. A hashed email is still personal data because it can be matched back to a person.
- Using one global banner for all regions. This either over-collects in the EU or needlessly limits data in the US.
- Ignoring GPC. In states that require it, ignoring it is a violation.
- Losing the consent record. If you cannot show when and how someone consented, you cannot prove compliance.
- Forgetting vendors. Consent covers the vendors you name. Adding a new pixel without updating the consent notice creates a gap.
What this means for measurement
When consent is denied or an opt-out applies, you lose user-level signals for that visitor. This is why later chapters cover consent-aware modeling, server-side collection with consent checks, and incrementality testing. These methods work with fewer signals. The legal rules set the boundaries they must stay inside.
Exercise
A US-based retailer sells to customers in Germany and Colorado. A visitor from each place arrives and has made no consent choice. A GPC signal is not present for either. Which of them may be tracked for advertising, and what changes if the Colorado visitor's browser sends GPC?
Show answer
The German visitor may not be tracked for advertising. GDPR and ePrivacy require opt-in consent before advertising cookies are set, and no choice means no consent. The Colorado visitor may be tracked, because Colorado uses an opt-out model and the visitor has not opted out, assuming the retailer has given proper notice. If the Colorado visitor's browser sends GPC, the retailer must treat it as an opt-out of targeted advertising and sale, so advertising tracking must stop for that browser.
Exercise
A team replaces a third-party advertising cookie with a first-party cookie set from its own domain and removes the consent banner for EU visitors. Explain why this is likely not compliant.
Show answer
ePrivacy requires consent to store or read information on a device unless it is strictly necessary, and it looks at the purpose, not the cookie's domain. An advertising ID stored in a first-party cookie is not strictly necessary, so consent is still required. If the cookie holds an ID linked to a person, GDPR also treats it as personal data, so the team needs a lawful basis, which for advertising is normally consent.
Exercise
Why does hashing an email address before sending it to an ad platform not remove the need for consent or a lawful basis?
Show answer
A hashed email can be matched against the platform's own hashed records, so it still identifies a person. Regulators treat it as personal data, so the same consent or opt-out rules apply to the upload.