Safari Intelligent Tracking Prevention (ITP)
Safari's Intelligent Tracking Prevention (ITP) limits how long a website can keep data that its scripts store in the browser. The TrueVault CMP stores a visitor's consent choices that way, so Safari visitors may see the consent banner again after 7 days, and any opt-out recorded only in their browser is lost.
This is a known limitation of Safari, and it affects any consent management platform that stores choices in the browser. This article explains what Safari does, how it affects the CMP, and what still carries over.
What Safari Does
ITP is on by default in Safari on macOS, iOS, and iPadOS. It is controlled by the Prevent cross-site tracking setting. Two of its rules apply to data a page's scripts write:
- Cookies set by JavaScript expire after 7 days at most. If a script sets a cookie with
document.cookie, Safari caps its expiration at 7 days, whatever expiration the script asked for. See Intelligent Tracking Prevention 2.1. - All script-writable storage is deleted after 7 days without interaction. If the visitor uses Safari for 7 days without interacting with your site, Safari deletes your site's script-written cookies and local storage. See Full Third-Party Cookie Blocking and More.
These rules are part of Safari, so neither your site nor TrueVault can turn them off or extend the limits.
How It Affects the TrueVault CMP
polaris.js runs in the browser and stores the visitor's state there:
- The
polaris_consent_settingscookie, which holds the visitor's consent and opt-out choices. The CMP sets it with a 180-day expiration, but Safari caps it at 7 days. - Local storage values such as the location cache and the GPC
polaris_auto_optout_submittedmarker.
When Safari removes this data, the CMP treats the visitor as a first-time visitor:
- The consent banner is shown again.
- The visitor gets a new anonymous
clientId. - Consent and opt-out settings go back to the defaults for the visitor's region until the visitor chooses again. For a visitor who had opted out, that means the opt-out is no longer recorded in their browser.
This is expected behavior in Safari and doesn't mean your CMP setup is wrong. Safari only deletes data in the visitor's browser. Consent records held by TrueVault, such as cross-platform consent records, aren't affected.
What Still Carries Over
Because the browser is the only place an anonymous visitor's choice can be stored, the CMP can't restore choices for anonymous visitors after Safari deletes them. Choices can carry over in these cases:
- Global Privacy Control. If the visitor's browser sends a GPC signal, the CMP detects it again on the next page load and opts the visitor out again, without needing anything stored.
- Logged-in Shopify customers. With Shopify cross-platform consent, TrueVault stores a logged-in customer's preferences and the CMP fetches them on page load. This has two limits:
- The CMP fetches the stored preferences after the page loads, so the region defaults apply until the response arrives.
- It only works if the customer is still logged in to your store. Whether a Shopify login lasts through Safari's limits depends on Shopify, not TrueVault.
- Your own login. If your site identifies consumers, you can use the email provider to store and fetch their preferences in the same way.
Testing
To see what a Safari visitor sees after their data is deleted, clear your site's cookies and local storage in Safari. See How do I clear the location cache when testing polaris.js? for the steps.