First-party cookies

First-party cookies decide whether a returning visitor is still the same visitor to your reports, and Safari's ITP decides how long those cookies get to live. 4 articles

A cookie belongs to the domain that set it. On your site, a cookie for your own domain is a first-party cookie; a cookie for facebook.com or doubleclick.net is third-party. That domain, and whether JavaScript or your server set the cookie, decides how long browsers let it live. Safari and iOS cap first-party cookies set by JavaScript, such as _ga and _fbp, at 7 days.

Server-set cookies used to escape that cap. Since Safari 16.4 they only do when the server that sets them looks like your own website, and a tagging subdomain on another server does not. Why Safari still caps your cookies at 7 days explains the check, and Same-Origin Tracking is the fix.

Start with first-party vs third-party cookies for the basics, then read extending cookie lifetime on Safari and iOS for what Cookie Keeper re-issues.

Start here: First-party vs third-party cookies, explained for marketers

First-party cookies

Frequently asked questions

What is the difference between first-party and third-party cookies?

It comes down to the domain a cookie belongs to. A cookie for your own domain or its subdomains is first-party; one for another company's domain, set by its script on your page, is third-party. Safari, Firefox and Brave block third-party cookies by default. First-party cookies still work, but how long they last depends on how they are set.

Why does Safari delete my _ga cookie after 7 days?

Safari's Intelligent Tracking Prevention caps cookies that JavaScript writes at 7 days, and at 24 hours when the visitor arrives from a link with tracking parameters on a known tracking domain. Since Safari 16.4 it also caps cookies set by a server that runs somewhere other than your website. A visitor who returns after a week then counts as a new user.

Does server-side tagging fix the 7-day cookie limit?

Not on its own. A tagging subdomain makes the requests first-party, but its IP address differs from your website's, so Safari still caps its cookies at 7 days. Same-Origin Tracking serves the tagging from a path on your own website, and Cookie Keeper then re-issues the cookies with their full lifetime.

Put it into practice

Start free, no credit card required.

Start free