Safari ITP & First-Party Cookies
400-day first-party cookies that survive Safari ITP
Apple's Intelligent Tracking Prevention deletes JavaScript cookies after 7 days if the visitor doesn't come back. Datafly Signal sets cookies via HTTP Set-Cookie headers from your own domain, which ITP treats as genuine first-party storage. The result: 400-day attribution windows for GA, Meta, TikTok, LinkedIn, and every click ID, with no workarounds and no fingerprinting.
400 days
Cookie lifetime
Compared with Safari's 7-day limit on JavaScript cookies
0
Browser fingerprinting
No canvas hashing, no font or plugin probing, nothing running in the visitor’s browser
30+
Vendor IDs persisted
GA, _fbp, _ttp, _li_id, click IDs all server-set in one cookie
Set-Cookie
Standards-based
HTTP header from your own domain, the way cookies were designed to work
What Safari ITP actually does to your cookies
Apple's Intelligent Tracking Prevention has been progressively tightening cookie controls since 2017. The current state of play affects every measurement and attribution surface you care about.
7-day limit on JavaScript cookies
Any cookie set by JavaScript, including the ones gtag.js, Meta Pixel, ttq.js, and the LinkedIn Insight Tag write, is deleted if the visitor doesn't come back within 7 days, whatever Max-Age the script asks for. A week away and they look like a "new visitor".
Just 24 hours after an ad click
When a visitor arrives from an ad click with gclid or fbclid in the link, Safari keeps JavaScript cookies on that landing page for just 24 hours. The window in which Smart Bidding can attribute a conversion to that click ID shrinks to a single day for client-side setups.
Multi-touch attribution stops working
With 7-day cookies, the full customer journey can't be reconstructed. Look-alike audiences shrink because the visit-history horizon shortens. ROAS calculations stop matching reality. Every Safari user who stays away for more than a week becomes a measurement gap, and Safari is roughly 19% of global mobile and 9% of desktop.
How Datafly Signal sidesteps ITP cleanly
Run on your own subdomain
Customers run a subdomain such as collect.yourbrand.com on the same infrastructure as their website, not as a CNAME to a vendor, with the Datafly Ingestion Gateway behind it. All event traffic, identity calls, and cookie-setting flows through that subdomain. The collector is loaded from your domain, not a vendor's.
Set cookies via Set-Cookie HTTP headers
When the gateway responds to a /collect or /identify request, it includes a Set-Cookie response header. Browsers store this as a first-party cookie scoped to the parent brand domain. ITP treats server-set first-party cookies fundamentally differently from JavaScript-set ones.
Set Max-Age to 400 days
Both Apple and Google formalised 400 days as the maximum cookie lifetime for first-party use. Datafly Signal sets exactly that on every cookie. Safari's 7-day limit on JavaScript cookies does not apply.
Mirror vendor identifiers server-side
The gateway generates and persists every vendor identifier server-side: GA client_id, Meta _fbp / _fbc, TikTok _ttp, LinkedIn _li_id, Pinterest _pin_, plus all click IDs. None of these need a client-side vendor cookie or vendor JavaScript anymore.
Refresh on every visit
Each event hit refreshes the cookie expiry, so as long as the customer visits within 400 days the identity persists indefinitely. Real customers never lose their identity to ITP. Bots and scrapers, by definition, don't come back.
The actual Set-Cookie header
No magic, no workaround, no probabilistic linking. The 400-day cookie is a single HTTP response header from your own domain. Below is what the gateway sends.
# How a 400-day first-party cookie is set
# 1. Datafly.js sends an event to https://collect.yourbrand.com/v1/p
# 2. Datafly Ingestion Gateway responds with a Set-Cookie header
# 3. Cookie is treated as first-party (server-set, your own domain)
# 4. No 7-day limit from ITP, ETP, or other browser controls
# Response header from collect.yourbrand.com:
Set-Cookie: _dfid=a3f9...; Path=/; Domain=yourbrand.com;
Max-Age=34560000; Secure; SameSite=Lax
# Max-Age = 34,560,000 seconds = 400 days, refreshed on every event
# Domain scoped to your brand, not a vendor's
# Not HttpOnly: the Datafly.js collector reads the same cookie
# SameSite=Lax allows cross-tab measurement
# The cookie holds only the anonymous ID. Against that identity,
# Datafly Signal stores server-side:
# - GA client_id, Meta fbp / fbc, TikTok ttp, Snapchat and Pinterest IDs
# (no _ga, Meta Pixel or ttq.js needed)
# - Click IDs: gclid, fbclid, ttclid, msclkid, twclidWhy server-set cookies just work
ITP, ETP, and Brave shields all distinguish between cookies set by the document and cookies set by the server. The latter is how cookies were designed to work in 1994 and remains supported.
400-day Max-Age, no rewrites
Server-set first-party cookies from your own domain keep the full expiry your gateway sets. Safari's 7-day limit on JavaScript cookies does not apply.
Secure + SameSite, readable by the collector
The identity cookie is Secure-only over HTTPS and SameSite=Lax for legitimate cross-tab measurement. It is not HttpOnly, because the Datafly.js collector reads it; the device-recognition cookie, which only the server needs, is HttpOnly.
Vendor IDs mirrored server-side
GA client_id, Meta fbp/fbc, TikTok ttp, Snapchat and Pinterest IDs generated and stored server-side against the visitor's identity. No vendor JS required.
Click IDs persisted on landing
gclid, gbraid, wbraid, fbclid, ttclid, msclkid, twclid captured from URL parameters at landing time and stored server-side against the same 400-day identity. ROAS over the full buying cycle.
Works the same on Firefox, Brave, Chrome
Firefox ETP, Brave Shields, and Chrome's upcoming controls all preserve server-set first-party cookies. The same recovery story works across every modern browser.
Deterministic by default
Cookie persistence needs no tricks. No canvas hashing, no font probing, no fingerprinting script of any kind. Just a first-party cookie set by your own server, the same primitive every site has used for thirty years.
Cookie lifetime by setup
How long the customer's identity actually persists across browsers, depending on how cookies are written.
| Setup | Safari | Firefox | Chrome |
|---|---|---|---|
| gtag.js (client-set _ga) | 7 days (24 hours after an ad click) | ~30 days | 13 months max |
| Meta Pixel (client-set _fbp) | 7 days | ~30 days | 90 days |
| GTM Server-Side via vendor subdomain | 7 days (server-set, but on vendor infrastructure) | ~30 days | 400 days |
| Datafly Signal (Set-Cookie HTTP header) | 400 days | 400 days | 400 days |
Frequently asked questions
- Why does Safari delete cookies after 7 days?
- Apple's Intelligent Tracking Prevention treats cookies set by JavaScript as a tracking risk. If the visitor doesn't come back within 7 days, Safari deletes them. Arrive from an ad click with gclid or fbclid in the link and the limit drops to just 24 hours. That is why _ga, _fbp, and other vendor-set cookies are regularly gone for Safari users who return after a week or more.
- Does Datafly Signal use any fingerprinting to extend cookies?
- No. There is no canvas hashing, no IP-based identity heuristic, no probabilistic stitching. The 400-day cookie is a standards-based first-party Set-Cookie response header from your own domain. Safari's 7-day limit on JavaScript cookies does not apply to it, because server-set first-party cookies are exactly what cookies were designed to be.
- How does this work on Firefox and Brave?
- Firefox Enhanced Tracking Protection and Brave Shields both preserve server-set first-party cookies on your own domain. The same 400-day cookie that survives Safari ITP also survives Firefox ETP and Brave. Chrome's upcoming controls preserve them too. The recovery story is uniform across every modern browser.
- What is the difference between server-set and client-set cookies?
- A client-set cookie is created by JavaScript via document.cookie. A server-set cookie is created by the server via a Set-Cookie HTTP response header. Browsers track both, but ITP and similar privacy controls treat them differently: server-set first-party cookies from your own domain keep their full Max-Age, while Safari deletes JavaScript cookies after 7 days if the visitor doesn't come back. The behaviour is documented in the WebKit ITP changelog.
- Will I lose data if a customer doesn't visit for 400 days?
- The cookie expires after 400 days of no activity. In practice, every visit refreshes the expiry, so as long as the customer returns within 400 days the identity persists indefinitely. For most B2C and B2B businesses 400 days covers more than the full buying cycle. Both Apple and Google formalised 400 days as the maximum first-party cookie lifetime, so you can't set longer than this on any browser.
- Does this require a CNAME or DNS change?
- A DNS change, but not a CNAME to a vendor. Safari limits cookies from a vendor CNAME to 7 days, so collect.yourbrand.com must run on the same infrastructure as your website, with the Datafly Ingestion Gateway behind it. The browser then sees the cookie as set by your own site, which is what makes it first-party and long-lived. No application changes.
Related
Identity Resolution
Vendor identifiers (_ga, _fbp, _ttp) generated server-side and persisted in the same 400-day cookie.
Attribution
Long-window attribution needs identity that outlasts Safari's 7-day cookies. ITP recovery is the foundation.
Mobile SDK
The mobile equivalent: deterministic identity in iOS Keychain and Android EncryptedSharedPreferences.
Google Ads
gclid persisted in the 400-day cookie, full Enhanced Conversions match window.
Recover the customers Safari ITP is hiding
Request a technical walkthrough. We'll show you what 400-day first-party cookies recover for Safari users specifically, and how the same setup extends every other browser too.