A customer clicks your Meta ad on an iPhone, browses two products and leaves. Nine days later they come back from a newsletter and buy. In your ad reports that purchase belongs to nobody: the cookie that linked the visitor to the ad click was deleted two days after the click. Nothing on your site is broken. Safari simply does what it was designed to do.
Safari’s Intelligent Tracking Prevention (ITP) shortens the life of many first-party cookies to 7 days, and in some cases to 24 hours. This post explains the two rules that matter for tracking, what they do to returning visitors, how to see them in Safari itself, and how to set cookies that survive. To check every cookie on your store at once, run our free website tracking checker.
The two rules
Rule 1: cookies written by JavaScript last at most 7 days
Any cookie created in the browser with document.cookie (which is how almost every tracking script works) is capped at 7 days in Safari, whatever expiry the script asks for. The _fbp cookie that the Meta pixel sets for 90 days, the _ga cookie GA4 sets for two years and the _ttp cookie TikTok sets for over a year all become 7 day cookies.
It gets shorter after an ad click. When a visitor arrives from a site that Safari classifies as a tracker, and the landing URL carries tracking parameters (the typical case for a click on a social or search ad with fbclid, gclid or ttclid), cookies written by JavaScript on that landing page are capped at 24 hours.
The 7 day limit also applies to other script-writable storage, such as localStorage, when the visitor has not interacted with the site for 7 days of browser use.
Rule 2: cookies from a CNAME or a different IP get the same cap
A common workaround was to set cookies from the server instead, using a subdomain like track.yourstore.com. A cookie set in an HTTP response with Set-Cookie is not written by JavaScript, so Rule 1 does not apply.
Safari closed the obvious version of that workaround:
- CNAME cloaking. If
track.yourstore.comis a CNAME that points to a third-party service, cookies it sets in HTTP responses are capped at 7 days, the same as JavaScript cookies. - Different IP address. Since Safari 16.4, the same cap applies when the subdomain resolves to an IP address that does not match your main site’s address closely (for IPv4, the first half of the address must match). A subdomain that points straight at a tracking provider’s servers fails this test even without a CNAME.
So the only cookies that keep their full lifetime in Safari are those set by a server response from your own infrastructure, on your own domain, from an IP address in the same range as your site.
What it does to returning visitors and attribution
Around a third of ecommerce traffic uses Safari, and on mobile in many markets it is more than half. For those visitors:
- A returning visitor looks new. After 7 days the identity cookie is gone, a new one is created, and analytics count a new user. Your new visitor numbers go up, your returning visitor numbers go down, and neither is true.
- Conversions lose their ad click. The
_fbccookie that stores Meta’s click ID and the_gcl_awcookie that stores Google’s are written by JavaScript. If the purchase happens more than 24 hours after the click (or 7 days, depending on how the visitor arrived), the platform receives a conversion without a click to attribute it to. - Matching gets weaker. Meta and TikTok use cookie IDs to connect events to people. Fresh, short-lived IDs match less often, which lowers your Event Match Quality and feeds the signal loss that makes campaigns look worse than they are.
Long consideration cycles are hit hardest: furniture, electronics, anything people compare for a week or two before buying.
How to check it in Safari
You can see the cap directly in Safari’s Web Inspector:
- In Safari, open Settings, Advanced, and turn on “Show features for web developers” (older versions: “Show Develop menu in menu bar”).
- Open your store, then choose Develop, Show Web Inspector.
- Go to the Storage tab and select Cookies, then your domain.
- Look at the Expires column for
_fbp,_ga,_ttpand any cookie your tracking relies on.
A cookie that Chrome shows expiring in 90 days or two years will show an expiry about 7 days from now. To see the 24 hour cap, open your store from a link with a click ID, for example from a real ad or from a test URL with ?fbclid=test123 opened from another site.
Also check where each cookie comes from. In the Network tab, select the response that set it and look for a Set-Cookie header. A cookie with no Set-Cookie header anywhere was written by JavaScript.
Why Chrome-based checkers need to compute this
Most tracking checkers, ours included, run on Chromium, because it is the browser that can be automated reliably at scale. Chromium does not apply Safari’s rules, so a Chromium scan sees the long expiry the script requested.
That is why our website tracking checker does not just read the expiry. For each cookie it records how the cookie was set (JavaScript or a Set-Cookie response), which host set it, whether that host is a CNAME to a third party, and whether its IP address matches your site’s. From that evidence it computes the lifetime Safari would give the cookie, and labels the result as computed so you know where the number comes from. A report row then reads, for example, “Set by: JavaScript, requested 90 days, Safari lifetime (computed): 7 days”.
The fix: server-set cookies from your own IP
To keep identity cookies alive in Safari, all three of these must be true:
- The cookie is set by a server response with a
Set-Cookieheader, not bydocument.cookie. - The response comes from your own domain, either your main domain or a subdomain of it.
- That host resolves to your own server’s IP address, in the same range as your main site, not to a CNAME or IP address of a tracking provider.
In practice that means routing tracking through your own web server or CDN: a path such as yourstore.com/t/ or a subdomain that points at your own infrastructure, which forwards the requests to your tracking provider behind the scenes. The cookie is set by your server, in the same IP range as your store, and Safari treats it as a real first-party cookie.
Our documentation on serving tracking from your own server walks through that setup with ready configurations for nginx, Apache, Caddy, Cloudflare, AWS CloudFront and Vercel. The general idea works with any server-side tracking setup; why server-side tracking matters covers the rest of the picture.
A few things this does not change:
- Safari’s Link Tracking Protection removes known click IDs such as
fbclidandgclidfrom URLs in Private Browsing and in links opened from Mail and Messages. No cookie fix can store a click ID that never arrives. - A visitor who clears their cookies, or uses a different device, is still a new visitor.
- Consent still applies. A cookie that needs consent needs it whether it is set by JavaScript or by your server.
Scan your store
Checking one cookie in Safari takes a few minutes. Checking every cookie, across every tag, and working out which rule applies to each, takes longer. Our free website tracking checker opens your store in a real browser, lists every tracking cookie with how it was set and its computed Safari lifetime, and tells you which ones to move to a server-set cookie first. It also covers pixels, deduplication readiness, consent behaviour and ad-blocker exposure.
Frequently asked questions
Does this affect Chrome users?
No. Chrome does not cap first-party cookies this way. Firefox and Brave have their own protections, which differ in detail, so a fix that works for Safari usually helps there too.
Are HttpOnly cookies exempt?
The rule is about how the cookie was set, not about the HttpOnly flag. A cookie set by a Set-Cookie response from your own infrastructure keeps its lifetime. HttpOnly is a good idea for identity cookies anyway, because scripts do not need to read them.
Is a CNAME to my tracking provider enough?
Not any more. Safari caps cookies set through a CNAME to a third party at 7 days, and since Safari 16.4 it also caps cookies from subdomains whose IP address does not match your site’s. The host that sets the cookie must be your own infrastructure.
Does server-side tracking fix this on its own?
Only if it sets cookies from your own server. Many server-side setups still rely on the pixel’s JavaScript cookies for identity, or run on a subdomain that points to the provider’s servers. Check how your identity cookie is set, not just where your events are sent.