← All resources Guide

First-party vs third-party cookies, explained for marketers

Every conversation about tracking ends up at cookies, and most of those conversations use "first-party" to mean "good" and "third-party" to mean "doomed". The real distinction is narrower and more useful: it is about which domain a cookie belongs to, and that single fact decides how long browsers let it live, which decides whether a visitor who comes back in three weeks is still the same visitor to your reports.

The definition

A cookie belongs to the domain that set it. On yoursite.com, a cookie for yoursite.com (or any of its subdomains) is first-party. A cookie for facebook.com or doubleclick.net, set because a script or pixel from that domain loaded on your page, is third-party. Same cookie, same company; what changes is the domain it is filed under, and whether the browser will send it back on the next visit.

What browsers do with each

Why marketers should care

CookiePlatformSet byIn Safari by default
_ga, _ga_*Google AnalyticsJavaScript, first-party7 days
FPIDGoogle Analytics via a server containerYour server, first-partyFull lifetime on your own domain
_gcl_aw, _gcl_gbGoogle AdsJavaScript, first-party7 days
_fbp, _fbcMetaJavaScript, first-party7 days
_ttpTikTokJavaScript, first-party7 days
_uetmsclkid, _uetvidMicrosoft AdsJavaScript, first-party7 days
_epikPinterestJavaScript, first-party7 days
li_fat_idLinkedInJavaScript, first-party7 days
__oppref, __obrefChatGPT AdsJavaScript, first-party7 days
fr, IDEMeta, Google (ad serving)Third-partyBlocked

What server-side tagging changes, and what it does not

Moving your tags to a server container on your own subdomain makes the requests first-party: the container and the hits come from mbase.yoursite.com instead of googletagmanager.com. The cookies in the table are still set by JavaScript in the browser, with the same 7-day cap, unless something re-sets them from the server. That is the job of two power-ups:

Click IDs that browsers strip from the landing URL before any cookie exists are a related problem, solved by Click ID Restorer.

Frequently asked questions

Is a CNAME subdomain first-party?

To the cookie specification, yes. To Safari, no: it detects CNAME cloaking and caps the cookies at 7 days, the same as a JavaScript cookie.

Is a tagging subdomain third-party?

No, it is a subdomain of your own domain, so its cookies are first-party and unaffected by third-party blocking. Safari's 7-day cap on cookies from a server in another IP range is a separate rule, and the one Same-Origin Tracking exists for.

Do I still need a cookie banner for first-party cookies?

Yes, for every cookie that is not strictly necessary for the site to work. Analytics and marketing cookies are not, whoever sets them.

Continue reading

Ready to move your tagging to Europe?

Start free, no credit card required. Live in about 15 minutes.

Start free