Safari ITP attribution: what the cookie limits do to your sources
By Devendra Variya, co-founder of Virling. Published 2026-11-24.
Safari ITP limits attribution by shortening the life of cookies that a script sets. WebKit caps them at seven days, and at one day on a landing page reached through a link with a query string from a domain it classifies as a cross-site tracker. A buyer who pays in the same visit, or comes back within the cap, keeps the same visitor ID. One who stays away longer returns as a new visitor, so the earlier source is not joined to the sale. The payment is still counted. What helps is a shorter time to pay, tagged links on every return path, and an email match where checkout has no ID.
What WebKit documents
ITP is Intelligent Tracking Prevention, part of WebKit, the engine in Safari. WebKit says most of its tracking prevention is on by default.
| What | What WebKit says | Source |
|---|---|---|
| Cookie set by script | A persistent cookie created through document.cookie is capped to a seven day expiry. A shorter expiry is kept, and session cookies are not affected | ITP 2.1 |
| Cookie set by script, no interaction | Cookies created in JavaScript, and other script-writable storage such as localStorage, are deleted after 7 days of no user interaction with the website. A click, tap or key press is interaction, scrolling is not | Tracking Prevention in WebKit |
| Link decoration | The cap is one day when a domain classified with cross-site tracking capabilities brought the visitor and the final URL has a query string or a fragment. It applies only for the current webpage | ITP 2.2 |
| Cookie set by the server | The seven day rule covers only cookies created through document.cookie, not cookies set in HTTP responses | ITP 2.1 |
| Cookie set by a cloaked server | Cookies set in HTTP responses are capped at 7 days when a subdomain points to a third party through a CNAME or a third-party IP address | Tracking Prevention in WebKit, Private Browsing 2.0 |
A tagged link has a query string, so it meets the second half of the link decoration rule. Whether the one day cap applies depends on the domain the visitor came from, which WebKit classifies and your site does not control. The first visit is still recorded with its tags; only the cookie set on that page is shorter.
Private Browsing goes further. After a cross-site navigation, third-party scripts that read the URL get it without query parameters or fragment, and the cross-site referrer is hidden from scripts. People can turn the same protections on for all browsing in Safari's settings (source: WebKit). For what Apple says about removing parameters from links, see iOS Link Tracking Protection and UTM parameters.
How it affects Virling
Virling's script sets its visitor ID, virling_vid, with document.cookie. It asks for one year, on your registrable domain so subdomains share it. It is first-party, but it is set by a script, so the caps above apply to it in Safari. Virling has no server-set version of this cookie, and serving the script from your own domain does not change how the cookie is set.
- The script writes the cookie again on each page load. Each write asks for a new year, which Safari caps again. By WebKit's description the seven days then run from the visitor's latest page load, not from the first one.
- The one day cap belongs to the landing page. If the visitor opens a second page on your site, the script writes the cookie again there. A visitor who reads one page and leaves has only the one day.
- Route changes in a single-page app are not page loads. They send pageviews but do not write the cookie again.
- Until consent writes it once. In that mode the cookie is set when the visitor accepts and is not renewed, so the seven days run from consent. In cookieless mode there is no cookie to cap, and no ID to pass into checkout.
- Hosted script in Private Browsing. There the script loads from another domain than yours, so WebKit's description of third-party scripts covers it. Expect no tags and no referrer, which reads as Direct.
What a Safari visitor who returns later looks like
Two made-up buyers in Safari, on a site that uses the default cookie mode. Both first arrive from a tagged newsletter link, read several pages, and later type the address and pay with the visitor ID passed into checkout. Neither is under the one day cap when they leave.
| Example only | Back on day 5 | Back on day 12 |
|---|---|---|
| Cookie | Still there, written again | Expired, so the script makes a new ID |
| In Virling | One visitor with two visits | Two visitors with one visit each |
| Visit the payment can be credited to | Newsletter or the Direct return | Only the Direct return |
| Credit under last non-direct | Newsletter | Direct |
| Measured time to pay | Days from the newsletter visit | Same day |
The revenue total is right in both. What changes is the channel. A longer attribution window does not fix the second buyer: the window looks back over one visitor's visits, and the newsletter visit is under another ID. First touch does not reach it either. The result is the same as for someone who changes device, as in cross-device attribution.
This pushes the report one way. Direct looks larger, and slow channels look smaller. The measured time to pay also looks shorter, since a late buyer's clock starts again.
What helps
- Shorten the time to pay. A buyer who pays in the first visit or within days is not affected. Start with how long a visitor takes to become a customer. If most of your customers pay the same day, the cap costs you little.
- Tag the links people come back through. A return from a tagged newsletter or trial email carries its own source, even under a new visitor ID. It is credited as that link, not as the link that first brought them, and under last non-direct it beats Direct. Build them with the UTM builder.
- Save the visitor ID with the account at signup. If people sign up in the first visit and pay later, store
virling_vidwith the account and pass that saved ID into checkout. The payment then joins to the visits of that ID inside the window, whatever the cookie holds by then. See passing the visitor ID into checkout. - Match by email where checkout has no ID. Send the email a visitor gives you at signup as an
identifyevent. A Stripe, Shopify or WooCommerce payment that arrives with no visitor ID and has the same payer email is credited to the first visitor who identified with it. Virling keeps only a salted hash of the email. If checkout carries an ID, that ID is used and the email is not, so this does not override a new Safari ID. See unattributed revenue. - Ask. A question at signup or checkout works in any browser; see self-reported attribution.
None of these makes the cookie last longer in Safari. Virling does not fingerprint visitors to get around the cap, and it never merges two visitor IDs into one.
Frequently asked questions
How long do cookies last in Safari?
A persistent cookie set by a script is capped at seven days, or one day when a domain WebKit classifies as a cross-site tracker sent the visitor to a URL with a query string or fragment. A cookie set in an HTTP response is not under that cap, unless WebKit detects CNAME or third-party IP address cloaking, which caps it at seven days.
Does Safari ITP affect first-party cookies?
Yes, when a script sets them. The seven day cap covers persistent cookies created through document.cookie, whoever wrote the script, and first-party analytics cookies are often set that way.
Do UTM parameters shorten the cookie in Safari?
Not by themselves. A UTM tag puts a query string on the URL, which is one of two conditions for the one day cap. The other is that a domain WebKit classifies with cross-site tracking capabilities brought the visitor.
How does Safari ITP affect Virling?
The virling_vid cookie is set by a script, so Safari caps it. The script writes it again on each page load in the default cookie mode. A visitor who returns after it has expired gets a new ID, and their earlier visits are not joined to the payment. The payment still counts toward revenue.
Does a longer attribution window fix Safari ITP?
No. The window decides how far back to look among the visits of one visitor ID. After the cookie expires, the earlier visit is under another ID, so no window reaches it.
Can Virling get around Safari's cookie limits?
No. It has no server-set cookie and does not fingerprint visitors. You can save the visitor ID with the account at signup and pass it into checkout, tag the links people return through, or match by email when a Stripe, Shopify or WooCommerce payment has no visitor ID.
See which channel brought each payment, and which have none
Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.