Cookies & tracking
First-party vs third-party cookies explained
A first-party cookie belongs to the site in the address bar, and a third-party cookie belongs to another site whose content is embedded on the page. Browsers treat them very differently, but privacy law cares more about what a cookie does than who sets it.
- Plain English
- Written for website owners
- Free to read
On this page
The difference between first-party and third-party cookies is about context, not about the cookie itself. A first-party cookie belongs to the site shown in the browser's address bar. A third-party cookie belongs to a different site, whose content (an ad, a video, a script or a pixel) is loaded on the page. The same cookie can be first-party when you visit one site and third-party when that site's content is embedded somewhere else.
The distinction matters because browsers restrict third-party cookies more and more. But for consent under privacy law, a cookie's purpose matters more than who sets it, and plenty of tracking now uses first-party cookies.
How a browser decides which is which
Browsers compare the cookie's site with the top-level site, the one in the address bar. A "site" here means the scheme plus the registrable domain, such as https://example.com. Subdomains count as the same site. The registrable domain is worked out using the Public Suffix List, which is why alice.github.io and bob.github.io are different sites, even though they share github.io.
Suppose a visitor is on https://www.shop-example.com/products:
| Cookie set for | Context | Why |
|---|---|---|
www.shop-example.com | First-party | Same host as the page |
.shop-example.com | First-party | Same registrable domain |
checkout.shop-example.com | First-party (same-site) | Subdomain of the same site |
shop-example-cdn.com | Third-party | Different registrable domain, even if you own it |
ads.example-adnetwork.com | Third-party | An embedded ad server |
Notice the fourth row. Owning a domain doesn't make its cookies first-party on your other domains. If your store runs on two domains, cookies shared between them are third-party from the browser's point of view.
A worked example: one page, two kinds of cookie
Take a news article on news-example.com that shows an ad served from adserver-example.net.
- The page response sets
session=…fornews-example.com. That's a first-party cookie. - The page loads an ad from
adserver-example.net. Its response setsuid=12345foradserver-example.net. In this context, that's a third-party cookie. - The visitor later reads a recipe on
recipes-example.org, which embeds the same ad server. The browser sendsuid=12345along with that ad request. - The ad server now knows the same browser visited both sites, and can build a profile across them.
If the visitor goes directly to adserver-example.net, the same uid cookie is first-party there. Cross-site recognition from step 3 is exactly what browser restrictions on third-party cookies are designed to stop.
How browsers treat third-party cookies
Browser policies have changed a lot in recent years, and they keep changing. As of late 2026:
| Browser | Default for third-party cookies | Notes |
|---|---|---|
| Safari | Blocked | Intelligent Tracking Prevention (ITP) has blocked all third-party cookies by default since 2020. It also caps many first-party cookies set by JavaScript to seven days. |
| Firefox | Partitioned, known trackers blocked | Total Cookie Protection keeps a separate cookie jar for each site, and Enhanced Tracking Protection blocks cookies from known trackers. |
| Chrome | Allowed in normal windows | Google abandoned its plan to phase them out. They're blocked by default in Incognito, and users can block them in settings. |
| Edge | Allowed, with tracking prevention | Tracking prevention blocks some known trackers, depending on the level the user picks. |
| Brave | Blocked | Blocks cross-site trackers by default. |
Chrome's history here is long. Google planned to deprecate third-party cookies, delayed it several times, and in 2024 and 2025 changed course to keep them. We track the current state in where Chrome's third-party cookie plan stands.
A cross-site cookie must also be marked SameSite=None; Secure. Chromium browsers treat cookies without a SameSite attribute as Lax, which keeps them out of most cross-site requests.
Partitioned cookies (CHIPS)
A third-party cookie can be marked with the Partitioned attribute. The browser then stores a separate copy for each top-level site. An embedded chat widget can still remember a visitor on your site, but the cookie it sets on your site can't be read when the same widget appears on another one. Partitioning limits cross-site tracking. It doesn't change whether the cookie needs consent.
The shift to first-party tracking
As browsers limited third-party cookies, tracking moved into the first-party context. Common techniques include:
- Script-set first-party cookies. Google Analytics 4 sets
_gaon your own domain. Meta's Pixel sets_fbpon your domain too. The script comes from the vendor, but the cookie is first-party. - Click IDs in URLs. Ad platforms add parameters like
gclidorfbclidto links. A script on the landing page saves the value in a first-party cookie. - CNAME records and server-side tagging. A subdomain such as
metrics.yoursite.compoints to a vendor's servers, so its cookies look first-party. Safari limits the lifetime of some cookies set this way. - Pixels and beacons that send data to third parties without needing a third-party cookie. See tracking pixels explained.
"We only use first-party cookies" isn't a privacy argument by itself. A first-party cookie that sends a persistent ID to an ad platform still tracks people. Regulators look at what the cookie does and where the data goes.
First-party cookies vs first-party data
Marketers also talk about "first-party data", and it's easy to mix the two up. First-party data is information a business collects directly from its own customers: email sign-ups, purchase history, account details, survey answers. It might be stored in a CRM or a database, not in a cookie at all.
The two ideas overlap only loosely:
- A first-party cookie can feed third-party systems. The
_fbpcookie sits on your domain, but its value is sent to Meta. - First-party data can be shared with third parties, for example by uploading a hashed customer email list to an ad platform. That doesn't involve cookies, but it still needs a legal basis and, in many places, consent or an opt-out.
- Strategies to replace third-party cookies with first-party data still involve personal data, so the same privacy rules apply.
When a vendor describes its tool as "first-party", ask where the data ends up and what the vendor may do with it. That answer, not the cookie's domain, decides how you treat it.
What this means for consent
Under the EU ePrivacy Directive, Article 5(3), and the UK's PECR regulation 6, the test is whether storing or reading the cookie is strictly necessary for a service the user asked for. Who sets it doesn't change the answer:
| Example | Party | Consent in EU/UK? |
|---|---|---|
| Login session, shopping cart, CSRF token | First | No, strictly necessary |
| Language preference the user chose | First | Usually no, if it's set because the user asked for it |
Google Analytics _ga | First | Yes in most cases. Some regulators exempt narrowly configured audience measurement, and the UK's 2025 reforms added an analytics exemption with conditions |
Meta _fbp, Google Ads _gcl_au | First | Yes |
| Ad network ID cookie | Third | Yes |
| Embedded video player cookies | Third | Yes, unless the visitor actively starts the embed and it's limited to what's needed |
Third-party cookies carry an extra issue: data sharing. When you embed a third party's code, you help it collect data. In Fashion ID (C-40/17, 2019), the EU Court of Justice held that a website that embedded Facebook's Like button was a joint controller with Facebook for collecting and transmitting visitors' data. In the US, sharing data with ad partners through third-party cookies or pixels can count as a "sale" or "sharing" under state laws like the CCPA, which triggers the opt-out right.
So the practical rule is the same for both kinds: classify each cookie by purpose, and block non-essential ones until the visitor agrees, where the law requires it. Our guide to blocking cookies until consent covers the techniques.
How to tell which cookies your site sets
You can check yourself in a browser:
- Open your site in Chrome and press F12 to open DevTools.
- Go to Application → Storage → Cookies and select your site's origin. The table can include cookies from other domains the page contacted, so compare the Domain column with your own domain to tell first-party from third-party.
- In the Network panel, turn on the 3rd-party requests filter (under More filters in recent Chrome versions) to see every request to other sites.
The full walk-through, including how to test before and after consent, is in how to check cookies in Chrome DevTools. Keep in mind that a manual check shows only what your browser does with its settings. A visitor in Chrome may receive third-party cookies that Safari would block.
Next steps
- Run a free cookie scan. It records cookies, local and session storage and third-party hosts in a real browser, and classifies each against a database of known trackers.
- Don't rely on browser blocking to protect you. Your obligations apply to what you ask the visitor's browser to do, not to what one browser happens to block.
- List each cookie with its party, purpose, duration and vendor, and use that list to keep your cookie policy accurate.
- Block analytics and marketing cookies, first- or third-party, until consent in opt-in regions. With PrivacyQuick, you tag each script with a category and it's released only after the visitor allows that category.
Frequently asked questions
Is Google Analytics a first-party or third-party cookie?
Google Analytics 4 sets its _ga cookies as first-party cookies on your own domain, using JavaScript from Google's script. The data still goes to Google, so in the EU and UK it's treated as an analytics cookie that needs consent, whoever's domain it sits on.
Do first-party cookies need consent?
Under EU and UK rules, it depends on purpose, not on who sets the cookie. A first-party login cookie is exempt as strictly necessary, while a first-party analytics or advertising cookie generally needs consent.
Does Chrome block third-party cookies?
As of late 2026, Chrome still allows third-party cookies by default in normal windows, after Google dropped its plan to remove them. It blocks them by default in Incognito, and users can block them in settings. Check Google's current announcements, as this has changed several times.
Is a cookie from a subdomain like shop.example.com third-party?
No. Browsers treat subdomains of the same registrable domain as the same site, so a cookie from shop.example.com on www.example.com is first-party.
Check your own website in 30 seconds
Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.
This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.