Quick answer
A first-party cookie is a cookie set by the website shown in the address bar, either by its server or by a script running on its pages. It is used for logins, carts, preferences and first-party analytics, and is sent only to that site.
What is a first-party cookie?
A first-party cookie is set by the site you are on, the one in the address bar. The server can set it in a response header, or a script on the page can write it. Only that site can read it back.
Sample first-party cookies by purpose
On a sample store, shop.example.com:
| Cookie | Purpose | Typically needs consent? |
|---|---|---|
session_id | Keeps you logged in | No, strictly necessary |
cart | Remembers the basket | No, strictly necessary |
lang | Remembers language | Usually no |
_analytics_id | Recognises returning visitors | Often yes, depending on region |
_ad_click | Stores an ad click ID for attribution | Often yes |
Being first-party says who sets the cookie, not what it is for. Consent rules follow the purpose. This is not legal advice.
First-party, but still limited
- Safari caps cookies created by JavaScript at 7 days, so a client-side analytics ID can reset after a week without a visit.
- Tracking protection may remove first-party cookies used for cross-site tracking via redirects.
- People clear them, and private windows start empty.
Server-set cookies on your own domain last longer, but the consent question stays the same.
Analytics without cookies
Counting visitors does not need a cookie at all. TapCub's website script writes no cookie and no local storage; the visitor ID is computed on the server. The trade-off is that the same person on a new network or browser counts as a new visitor. See cookieless analytics and third-party cookies.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Solutions Engineer
Covers SDKs, API integrations, and data implementation, with an emphasis on validation, system interoperability, and troubleshooting.