Every tracker on your site is either first-party or third-party, and the difference is not just technical detail. It shapes how browsers treat the tracker, what consent rules apply, and how much risk it carries. This post explains the distinction, how the SameSite attribute ties in, and why the line between the two is blurrier than it looks.
The core distinction
A first-party tracker is set by the domain the visitor is on. A third-party tracker is set by a different domain, usually through embedded content like ads, analytics, or social widgets. The browser decides which is which by comparing the cookie's domain to the site in the address bar.
| First-party | Third-party | |
|---|---|---|
| Set by | The site the visitor is on | A different domain via embeds |
| Typical use | Sessions, cart, first-party analytics | Ad pixels, cross-site analytics, social |
| Browser treatment | Generally allowed | Increasingly restricted |
| Consent (EU) | Non-essential still needs consent | Non-essential needs consent |
Do not confuse 'first-party' with 'no consent needed'. Under the ePrivacy Directive, what matters is whether the storage is strictly necessary for the requested service. A first-party analytics tracker is still non-essential and still needs consent in the EU, even though it is first-party.
Where SameSite fits in
The SameSite attribute tells the browser when a cookie may be sent. It controls whether a cookie may be sent in same-site or cross-site request contexts; it does not by itself determine who the first or third party is.
Set-Cookie: session=abc; SameSite=Strict // only first-party, same-site
Set-Cookie: ad=xyz; SameSite=None; Secure // cross-site allowed, HTTPS only
Set-Cookie: pref=1; SameSite=Lax // first-party + safe top-level nav (browser default)- Strict: sent only in first-party, same-site contexts.
- Lax: first-party plus safe top-level navigations; the modern browser default.
- None: allows cross-site sending, but requires the Secure attribute so it only works over HTTPS.
Why the line is blurry
The distinction is muddied by server-side tracking and first-party proxying, where a third-party service routes its data through your own domain so the tracker looks first-party to the browser. That can dodge third-party restrictions, but it does not change the underlying purpose or the consent obligations. A cross-context advertising tracker routed through your domain is still cross-context advertising, and the law looks at the activity, not just the domain.
First-party proxying can reduce browser friction, but it is not a consent loophole. If you collect data for advertising or analytics through your own domain, you still need a lawful basis and, in the EU, consent for non-essential processing. Relabeling the domain does not relabel the purpose.
Why it matters for consent
- Third-party trackers are the primary target of browser restrictions and phase-outs, so they carry the most operational risk.
- Consent gates apply to both, based on whether the tracker is necessary, not on which party sets it.
- Your tracker inventory should record the party for each entry, because it affects how you categorize and enforce it.
First-party and third-party describe where a tracker comes from, and browsers treat them differently. But for consent, the real question is whether the tracker is necessary for what the visitor came to do. Classify by purpose, record the party, and let the consent category decide what loads.
Materially reviewed July 11, 2026. Regulatory and implementation guidance is general information, not legal advice.
Primary sources
Was this post helpful?
Put consent in front of your trackers
OptinStack pairs a first-layer consent banner with enforcement that respects what each visitor chose, plus consent evidence. Create a free account and activate one production hostname; upgrade when you need more design, exports, capacity, or regional controls.
Related posts
Tracker inventory: what is actually running on your site
What a tracker inventory is, why it matters, how trackers map to the four consent categories, and how to keep the inventory honest as your site changes.
Consent enforcement: blocking vs releasing scripts by category
What consent enforcement is, how trackers get gated by category, the common failure modes like load-order gaps, and how to verify the page actually obeys each visitor's choice.
What is PII (personally identifiable information)?
What actually counts as PII, how it differs from personal data under the GDPR, and why the distinction matters for the trackers running on your site.
What is a consent management platform (CMP), and do you need one?
What a consent management platform is, the components that make it work, the fixed consent categories, and how to tell whether your site needs one.