The platform26 min read
How long do affiliate cookies last? Safari, ITP and consent
Co-founder, product and technology
The short answer
- An affiliate cookie lasts as long as the program's cookie window says – if the browser lets it live. At Affilyflow the store chooses 14–90 days, and we recommend 30.
- In Chrome, Edge, Firefox and on Android the click lasts the whole window. In Safari on Mac, iPhone and iPad the browser deletes everything a script stores about 7 days after the customer's last visit – and a cookie can sometimes be capped at 24 hours.
- Only a cookie set by the store's own server lasts the whole period in Safari. A tracking subdomain that points to a third party is capped at 7 days too.
- If the customer buys on another device, or says no to cookies while tracking waits for consent, a personal discount code is the only route to commission at Affilyflow – unless the customer clicks the link again on the new device. The code needs no storage in the browser.
In this article · 10 sections
How long do affiliate cookies last – and does the 30-day cookie duration a program promises affiliates also hold on an iPhone? The answer depends on two things that are often mixed up: the program's cookie window and the cookie's lifetime in the browser.
This guide separates the window from the lifetime. You get a dated overview of the browsers as of November 2026, nine situations that decide who gets the sale, and the setups that last the whole period on each platform. It is written for store owners and their developers who are choosing a network or an integration, and for affiliates who wonder whether they lose commission in Safari – their advice is in the section on how to lose the least commission. If you are new to the subject, start with our guide to affiliate marketing.
- is how long Safari keeps cookies and storage set by a script after the last visit
- 7days
- WebKit's rules for Tracking Prevention
- is the cap on a script cookie when the link came from a domain Safari has classified
- 24hours
- Applies to the cookie on the landing page (ITP 2.2)
- from the click is how long a cookie can live when the store's own server sets it
- 90days
- The WooCommerce plugin and the server snippets
- is the cookie window we recommend – a program can be set to 14–90 days
- 30days
- The window is locked on the click and decided on our server
Cookie window (cookie duration) vs cookie lifetime: two different things
The cookie window, also called the cookie duration or attribution window, is a rule: how long after a click a purchase still earns commission. The store chooses it per program – at Affilyflow 14, 30, 45, 60 or 90 days, and we recommend 30. The window is locked on the click and decided on our server from the click's own timestamp, so the browser can neither extend nor shorten it.
The cookie lifetime is something else entirely: how long the click ID is actually stored in the customer's browser. That depends on the browser – and on who set the cookie. Our script stores the click for up to 90 days from the click, but the browser can delete it sooner. A purchase only earns commission when both hold, and the shorter of the two decides: a program with a 30-day window gives 30 days in Chrome, Edge, Firefox and on Android, but about a week after the last visit in Safari, if only a script stored the click.
| Term | What it means | Who decides |
|---|---|---|
| Cookie window (attribution window) | How long after the click a purchase earns commission | The store, per program – at Affilyflow 14–90 days |
| Cookie lifetime | How long the click ID actually stays in the customer's browser | The browser – and who set the cookie: a script or the store's server |
| Click ID | The ID that links the purchase to the click that led to it | Affilyflow creates it when the customer clicks |
How long affiliate cookies last, browser by browser
The matrix shows how long a click survives with each tracking method, as of November 2026. It is built on the browsers' own documentation, and how we lock the click and the window on the server is described on affiliate tracking. What we have not been able to verify is in the sections on iPhone browsers and in-app browsers below – not in the table.
| Method | Chrome, Edge, Firefox and Android | Safari on Mac, iPhone and iPad | Private window |
|---|---|---|---|
| Cookie set by a script (track.js and other tracking scripts) | The whole window, up to 90 days from the click | About 7 days after the last visit – on the landing page sometimes 24 hours | Until the private window is closed |
| Browser storage, localStorage (the Shopify pixel and the script's backup) | The whole window | Deleted after 7 days of Safari use without a click or tap on the site | Until the private window is closed |
| First-party cookie set by the store's own server (the WooCommerce plugin, the server snippets) | The whole window, up to 90 days from the click | The whole window, up to 90 days from the click | Until the private window is closed |
| Tracking subdomain pointing to a third party (CNAME or A record) | The whole window | 7 days | Until the private window is closed |
| Click ID only in the URL, nothing stored | Only that visit | Only that visit | Only that visit – Safari can strip known click IDs from the URL |
| Personal discount code | Works – nothing is stored | Works – nothing is stored | Works – nothing is stored |
Sources, read in November 2026: WebKit, Mozilla, Google Privacy Sandbox and Stape – the full list is at the end. A customer can always delete cookies themselves; the table shows what the browser does on its own.
Where in the click's journey the browser decides
This is how the click travels from the affiliate's link to a recorded sale. The full technical version is in How tracking works.
The click is recorded
The affiliate's link goes through Affilyflow. The click is recorded here, and the commission and the cookie window are locked on it with our server's timestamp.
The customer lands with a click ID
The store opens with ?afid=c_… in the address. The click ID is in the URL, but it is not yet stored in the customer's browser.
The store's tracking stores the click
A script, the Shopify pixel, the WooCommerce plugin or the store's own server stores the click ID on the store's domain. This is where the browser decides how long it lives.
The purchase is reported – and the server decides
The order is reported with the click ID, and our server checks the click's age against the window that was locked at the click. A new visit never extends the window.
Safari ITP and affiliate tracking: 7 days – and sometimes 24 hours
Safari's tracking protection is called Intelligent Tracking Prevention (ITP) and is part of WebKit, the engine behind Safari on Mac, iPhone and iPad. Apple has tightened it several times. In 2019, cookies set by a script were capped at 7 days. In March 2020 (Safari 13.1 and iOS 13.4), third-party cookies were blocked completely, and all storage a script can write – localStorage included – is now deleted after 7 days of Safari use without interaction with the site.
| Year | Safari/iOS | Rule |
|---|---|---|
| 2019 | ITP 2.1 | Cookies set by a script are capped at 7 days |
| 2019 | ITP 2.2 | Script cookies on the landing page are capped at 24 hours when the link came from a classified domain |
| 2020 | Safari 13.1 / iOS 13.4 | Third-party cookies blocked; storage a script writes is deleted after 7 days without interaction |
| 2020 | Safari 14 / iOS 14 | Cookies from subdomains with a CNAME to a third party are capped at 7 days |
| 2023 | Safari 17 / iOS 17 | Private Browsing strips known click IDs from the URL |
Interaction means a click, a tap or a keystroke on the site. Scrolling does not count. Our script writes the cookie again on every visit, so it lasts 7 days from the customer's last visit – but never beyond 90 days from the click, and the renewal never extends the window. The storage, on the other hand, is deleted after 7 days of Safari use without a click or tap on the site. If the customer does not come back within a week, a click that only a script stored is gone.
The 24 hours come from a stricter rule from 2019 (ITP 2.2). If the customer arrives from a domain Safari has classified as a tracking domain, and the landing URL has parameters such as ?afid=, cookies that a script sets on that very page are capped at one day. Among other things, Safari classifies domains that redirect to many different sites – which is exactly what an affiliate link does, ours included. Nobody can tell from the outside whether that has happened on a particular iPhone. That is why our script stores the click both as a cookie and in browser storage, and restores the cookie from storage on the next visit – but the storage does not last more than about 7 days either.
Chrome, Firefox and Edge on iPhone are not the same as Safari, and we have not verified which of Safari's rules they follow. The matrix applies to Safari.
Chrome, Edge, Firefox and Android
Here a first-party cookie on the store's domain lasts the whole window. In its update of 17 October 2025, Google retired most of its Privacy Sandbox technologies, and Chrome leaves third-party cookies to the user's own choice. Firefox's default protection, Total Cookie Protection, partitions third-party cookies per site. Neither affects a click stored as a first-party cookie at the store – and at Affilyflow, attribution never relies on a third-party cookie. Here the click is only lost because of the customer: cleared cookies, a private window or a purchase in another browser.
Private browsing and in-app browsers in Instagram and TikTok
A private window forgets everything when it is closed – in every browser. From version 17, Safari's Private Browsing goes further with Link Tracking Protection: known click IDs are stripped from the URL before the page opens, and scripts from another domain get the URL without parameters. A tracking script loaded from the network's domain therefore cannot count on seeing the click ID in a private tab. The store's own server sees the URL as it was requested. The same rules apply in normal tabs for people who have turned on Advanced Tracking and Fingerprinting Protection for all browsing.
Instagram and TikTok open links in their own browser inside the app. Clicks from there count as clicks with us, and if the customer buys in the same session in the app's browser, the sale is normally recorded as usual – we have not verified that in every app. But the app's browser generally has its own storage, separate from the phone's Safari or Chrome, so if the customer later opens the store in their regular browser, that browser has no record of the click. We have not tested how long storage lasts inside the app itself either. The safest backup is a personal discount code that the creator can say out loud or write in the post – see also our guide to making money on TikTok and Instagram.
Does a tracking subdomain help? No – how the CNAME rule works
A common idea is to give tracking a subdomain such as track.yourstore.com that points to the network's server with a CNAME or A record. The server then sets the cookie in a response from the store's own domain, so the cookie looks like a first-party cookie that Safari would let live. Safari has closed both routes.
Since Safari 14 and iOS 14 (2020), Safari detects a subdomain whose CNAME points to a third party and caps all cookies from its responses at 7 days. A similar rule for IP addresses came later: if the subdomain's IP address does not resemble the main site's, the cookie is capped at 7 days too. According to Stape, which cites WebKit's source code, the first 16 bits of an IPv4 address or the first 64 bits of an IPv6 address must match. A subdomain that points to a third party therefore gives the same 7 days as a script.
What works is the store's own server or CDN setting the cookie: the WooCommerce plugin or the server snippets for a custom-built store. A path on your own host, such as /af/, that is forwarded to us makes it harder for ad blockers to stop tracking – and according to WebKit's description, a script from your own domain is not covered by the Private Browsing rule about URLs without parameters.
Important
A path on your own host – never a subdomain
A subdomain that points to us gives no longer lifetime in Safari. A path such as yourstore.com/af/ makes the script and its calls first-party, and a cookie set by your own server lasts the whole period.
Cookieless affiliate tracking: what the term really covers
Cookieless affiliate tracking sounds like the answer to both Safari and consent. In practice, the term covers four very different things, and they do not solve the same problem.
| Method | What happens | At Affilyflow |
|---|---|---|
| Fingerprinting | The device is recognized from signals such as screen, language and IP address – without storing anything | Not used. We do not recognize the same person across days or devices |
| Discount code | The customer types a code at checkout. Nothing is stored in the browser | A personal code earns commission without a click. A code for all affiliates does not |
| Server-to-server (S2S, postback) | The store's server reports the sale directly to the network | The WooCommerce plugin, the Stripe webhook and the store's API key report from the server. The Shopify app reports from the browser |
| Click ID only in the URL | The ID follows the link but is forgotten when the customer leaves the page | Always carries the click to the store – after that it has to be stored |
S2S tracking: what server-to-server solves – and what it does not
The key point: a sale can be reported server to server, but the click still has to be remembered somewhere between landing and buying – in a cookie, on the customer's account or on the order. Server-to-server tracking (S2S tracking, also called postback or server-side tracking) solves how the sale gets through to the network – not how long the click survives, and not the question of consent to store it. That is why we do not call Affilyflow cookieless: attribution is built on a click ID and a first-party cookie. The glossary entry on cookieless tracking goes through the term.
What referral software works with Safari ITP?
Any solution where the store's own server stores the click and reports the sale. The vendor's name matters less than the answers to four questions:
- Does the store's own server set the cookie – from the store's own domain, and not from a subdomain that points to the vendor?
- Is the sale reported server to server, so an ad blocker or a closed tab does not stop it?
- Can a personal discount code earn commission when there is no click to link the sale to?
- Can you see how many affiliate clicks arrive, get stored and turn into a sale?
At Affilyflow the answer is yes to all four for WooCommerce and for custom-built stores using the server snippets. Personal discount codes can be used on most of our platforms – on many only when the order confirmation or GA4 sends the code along – but not yet in the Shopify app.
Affiliate cookie consent: when the customer says no
If the store has chosen "Wait for consent" and the customer says no, the click is never stored – and then only a personal discount code can earn commission.
What happens depends on the store's setup. The store owns the site and the cookie banner and chooses whether tracking should wait for consent. With "Wait for consent", the script stores nothing in the browser until the customer has accepted marketing. The click ID is only held in the page's memory, so if the customer says no, a later purchase earns the affiliate no commission.
An active no also deletes what has already been stored, including the click cookies the store's server has set. Without that setting the script behaves as it always has, and consent is handled by the store's own cookie solution.
The script reads consent itself from these solutions:
- Cookiebot and Cookie Information
- IAB TCF v2
- Google Consent Mode v2
- The built-in banners of Shoporama, DanDomain Classic and Smartweb/HostedShop, three Danish e-commerce platforms
If the store uses another solution, the developer has to tell the script. From version 1.12.0, the WooCommerce plugin follows banners that support the WP Consent API, and the Shopify pixel does not ask on its own – the store's own cookie solution takes care of that. The details are in Consent and cookies.
The only route to commission that needs no storage in the browser is a personal discount code: a code the store ties to one specific affiliate. The customer types it in, so it also works when the customer has declined marketing cookies. With the tracking script and the WooCommerce plugin, an order without a click is only reported to us when the customer used a personal code – they compare the code with hashes of your personal codes before anything is sent.
Whether an affiliate cookie requires consent is a legal question, and this is not legal advice. Two sources are worth knowing. The European Data Protection Board (EDPB) names affiliate marketing in Guidelines 2/2023 on Article 5(3) of the ePrivacy Directive (version 2.0, October 2024, section 3.1) and counts tracking links too, not just cookies. In Denmark, the joint cookie guidance from the Danish Data Protection Agency (Datatilsynet) and the Danish Agency for Digital Government (15 May 2025) describes that only what is technically necessary to provide a service the user has asked for – such as login and the shopping cart – is exempt from the consent requirement (section 4(2) of the Danish cookie order). Outside the EU and EEA the rules differ – the UK, for example, has its own in PECR. Ask your own advisor.
Who gets the sale? 9 situations explained
Affilyflow uses a single model: the sale belongs to the click ID the order carries – last click wins, and commission is never split between affiliates. The rate is locked the moment the customer clicks. This is how it plays out in the situations stores and affiliates ask about most:
| Situation | Who gets the commission | Rate | What saves the sale |
|---|---|---|---|
| The customer clicks and buys within the window | The affiliate behind the click | The rate locked at the click | Nothing – this is how it should work |
| Click in Safari, purchase 10 days later with no visit in between, and only a script stored the click | Usually nobody – the click has been deleted | – | A cookie from the store's own server, or a personal discount code |
| The customer first clicks affiliate A's link, later affiliate B's | B – the most recent stored click | B's locked rate | No splitting – last click wins |
| The customer clicks the same affiliate's link again shortly after | The same affiliate – it counts as the same click | The first click's rate | – |
| The customer rejects cookies but uses a personal discount code | The affiliate the code belongs to | The program's current rate | The code – it needs no storage in the browser |
| A valid click from A and a personal discount code from B | A – a valid click always beats a code | A's locked rate | – |
| Click on the phone, purchase on the computer | Nobody – unless the customer uses a personal discount code or clicks the link again on the computer | The program's current rate | A personal code – the click does not follow the customer between devices |
| WooCommerce: another network's click came after ours, and "Last click wins" is on | Nobody at Affilyflow – the order is not reported to us | – | A new click on an Affilyflow link makes the sale ours again |
| The customer uses a discount code for all affiliates and has no click | Nobody | – | The click on the affiliate's link, or a personal code |
The WooCommerce row, where another network's click came last, is a deliberate rule. From version 1.10.0, the WooCommerce plugin has "Last click wins" switched on by default: if the customer lands via another network's link after our click, the plugin forgets our click, so you do not pay us for a sale where another network had the most recent click. If the other networks' pixels should follow the same rule, you can make them conditional on the winner – see the WooCommerce guide. A code gives the program's current rate because there is no click to lock the rate on.
As an affiliate: how to lose the least commission in Safari
You cannot choose the customer's browser, but you can do three things. Ask the store for a personal discount code and share it alongside your link – it earns commission without a click, also when the customer has declined cookies or buys on another device. Link directly to the product you recommend, so the path from click to purchase is short. And ask the store how it tracks: if it saves the click from its own server, you get the whole window – Safari included.
Whatever the browser, the rate and the window are locked on our server when the customer clicks. A click that lasts until the purchase earns the rate the program showed at the click – even if the store changes its rate afterwards.
For affiliates
Want clicks that are locked on the server?
At Affilyflow the commission and the cookie window are locked the moment the customer clicks, and the click's age is decided on our server – not by anything the browser reports.
How to make tracking last the whole window – platform by platform
The most robust route depends on where you sell. The table shows what lasts the whole period in Safari on each platform, and what catches the rest:
| Platform | What lasts the whole period | Backup and next step |
|---|---|---|
| WooCommerce | The plugin stores the click from your own server for 90 days and reports the order from the server | Personal discount codes work automatically, and from version 1.12.0 the plugin follows cookie banners that use the WP Consent API |
| Custom-built store | The server snippets (Laravel, PHP, Node.js or Next.js) store the click on your own server | Report the sale from the server with the store's API key: it then shows as "Confirmed by server", and the order time is sent along, so a sale reported later does not fall outside the window |
| Stripe | The webhook reports the payment server to server. Pass the click ID as client_reference_id when your server creates the Checkout Session, and let your own server store the click | With the tracking code on the page, Payment Links get the click ID automatically – but then Safari's 7 days apply |
| Shopify | No route yet – the app's pixel stores the click in the browser, so Safari deletes it after about 7 days | Install the Affilyflow app from the Shopify App Store; the pixel needs no code in the theme |
| Smartweb, DanDomain, Shoporama and other script platforms | The tracking code stores the click in the browser, so Safari deletes it after about 7 days | Give your most important affiliates a personal discount code, and check in the guide whether your order confirmation sends the code along |
Before the first affiliate sends traffic
- If you have a cookie banner, check that the script can read it – otherwise your developer has to tell the script about the customer's choice.
- Make a free test purchase with the test link under Setup.
- Choose a cookie window that fits your customers' buying journey – we recommend 30 days.
Watch out
The Shopify app and Safari
The Affilyflow app's pixel stores the click in browser storage for up to 90 days. The storage is written by a script, so Safari deletes it about 7 days after the customer's last visit – the same rule as for all tracking that runs in the browser. The app does not yet have a route from the store's server or support personal discount codes. In Chrome, Edge, Firefox and on Android the click lasts the whole window.
Once tracking is running, "Tracking coverage" under Setup shows, for the last 30 days, how many affiliate clicks reached tracking, were stored and turned into a sale. It is the closest you get to seeing what Safari and the cookie banner cost you.
For web shops
Ready to set up tracking on your store?
Setup shows the route for your platform, and a test purchase with the test link costs nothing. You only pay for approved sales.
How long should affiliate cookies last in your program?
Choose the window from your customers' buying journey, not from Safari. At Affilyflow a program can have 14, 30, 45, 60 or 90 days, and we recommend 30. In Chrome, Edge, Firefox and on Android – and in Safari too, with a cookie from your own server – the window holds in full, and it is the number affiliates see and compare before they choose your program.
A short window makes the program less attractive: if you choose 14 days, the program editor warns that affiliates tend to pass over programs with short windows. A long window, on the other hand, means you pay for purchases that happen long after the click. If your customers have a long buying journey – expensive products, furniture, travel – 45, 60 or 90 days can make sense. If they buy on impulse, 30 days is plenty.
The window is locked on each click. If you extend it later, it only applies to new clicks; existing clicks keep their original window. The rules are collected on the program terms page.
So the honest answer to how long affiliate cookies last is: as long as the window says, if the browser lets them live. If you want the whole period – Safari included – the click has to be stored by your own server. See how price and terms fit together when you start an affiliate program.
Sources, read in November 2026: WebKit (Tracking Prevention in WebKit and the blog posts on ITP 2.2, Full Third-Party Cookie Blocking and More from March 2020, CNAME Cloaking and Bounce Tracking Defense from November 2020, and Private Browsing 2.0); Mozilla (the overview of Firefox's tracking protection); Google (the Privacy Sandbox update of 17 October 2025); Stape on the IP rule for subdomains, citing WebKit's source code; EDPB, Guidelines 2/2023, version 2.0; Datatilsynet and the Danish Agency for Digital Government, the joint cookie guidance (15 May 2025).
Frequently asked questions
How long do affiliate cookies last?
As long as the program's cookie window says, if the browser lets them live. At Affilyflow the store chooses 14–90 days, and we recommend 30. In Chrome, Edge, Firefox and on Android the click lasts the whole window. In Safari on Mac, iPhone and iPad the browser deletes cookies and storage set by a script about 7 days after the customer's last visit. A cookie set by the store's own server lasts the whole period.
What is the difference between cookie duration, the attribution window and a cookie's lifetime?
Cookie duration, the cookie window and the attribution window are the same thing: the period after a click in which a purchase earns commission. The store chooses it, and at Affilyflow it is locked on the click and decided on our server. The cookie's lifetime is how long the click ID actually stays in the customer's browser, and the browser decides that. The shorter of the two decides whether a purchase counts.
How long should an affiliate cookie window be?
Choose it from your customers' buying journey. At Affilyflow a program can have 14, 30, 45, 60 or 90 days, and we recommend 30. A long window makes sense for expensive products with a long buying journey, while 30 days is plenty for impulse purchases.
Why don't affiliate cookies last as long in Safari and on iPhone?
Safari's tracking protection, Intelligent Tracking Prevention (ITP), caps cookies set by a script at 7 days and deletes localStorage after 7 days of use without interaction with the site. If the customer comes from a domain Safari has classified as a tracking domain, a script cookie on the landing page can be capped at 24 hours. The rules affect everyone who tracks with a script in the browser.
What happens to affiliate commission if the customer rejects cookies?
If the store's tracking waits for consent, the click is not stored, and a later purchase earns the affiliate no commission. If the customer uses a personal discount code that the store has given a specific affiliate, that affiliate still earns commission, because the code needs no storage in the browser. A discount code for all affiliates does not earn commission on its own.
What happens if the customer buys on another device?
The click does not follow the customer between devices, because it is stored in the browser the customer clicked in. If the customer clicks the affiliate's link again on the other device, that is a new, valid click. Otherwise only a personal discount code that the store has tied to a specific affiliate can earn commission on the purchase.
Do affiliate links work in the Instagram and TikTok in-app browser?
Yes, the click counts, and if the customer buys in the same session inside the app, the sale is normally recorded. The app's browser has its own storage, so if the customer later opens the store in Safari or Chrome, that browser has no record of the click. A personal discount code is the safest backup.
Does a tracking subdomain (CNAME) get around Safari's 7-day limit?
No. Safari caps cookies at 7 days when a subdomain points to a third party with a CNAME record, and when the subdomain's IP address does not resemble the main site's. Only a cookie set by the store's own server or CDN lasts the whole period. A path on the store's own host, such as /af/, makes it harder for ad blockers to stop tracking, but gives no longer lifetime on its own.
What referral software works with Safari ITP?
Any solution where the store's own server stores the click as a first-party cookie and reports the sale server to server. Ask whether the cookie is set from the store's own domain and not from a subdomain, and whether a personal discount code can earn commission without a click. At Affilyflow the WooCommerce plugin and the server snippets for custom-built stores do that.
Further reading
More articles
- The platform11 min readThe manifesto: affiliate numbers you can verifyCommission locked at the click, public program metrics and a fee never taken from the affiliate's rate – the manifesto behind Affilyflow, and what we do not promise.
- For web shops25 min readAffiliate fraud detection: how to spot ad hijacking and botsAffiliate fraud detection: eight fraud types from ad hijacking to cookie stuffing, the signals in your own data, and what to do before a sale is approved.
- For web shops25 min readEcommerce marketing channels: what a sale costs in eachEcommerce marketing channels sorted by what you pay for – views, clicks or sales – with break-even ROAS and a calculator for your own cost per sale.

Written by
Co-founder, product and technology
Builds Affilyflow – the affiliate network from Denmark where businesses and affiliates can see exactly what their partnership delivers.
Found a number that no longer holds? Write to us – we will correct the article.