Cookie Expiry In WebKit/Safari Browsers

Apple's ITP aggressively expires advertising data in Safari (WebKit) based browsers causing signification tracking issues

Marketing technologies use cookies (and Local Storage) to connect user ad clicks to conversions. Let's discuss a simple scenario. A user clicks on your Google Ad. They land on your site. Your Google Ads tracking tag automatically saves an id called a "gclid" in a cookie on your browser. When the user makes a purchase on your site, the Google Ads tags automatically pickup the value of this cookie, and send it to Google at the time of purchase. Google Ads looks at this value, connects it to the original ad click, and is able to credit that ad click with initiating the sale on your site. All is well. Your Google Ads look like they're performing.

Cookies have an expiry date, enforced by your browser. If the cookie where the "gclid" is saved expires, the transaction will still be sent to Google Ads, but Google Ads won't know that it should take credit for the sale. Hence your conversion count in Google Ads reads 0.

Note this issue is present for all ad channels. Not just Google. Facebook, TikTok, Snapchat etc... are all affected in the exact same way

Safari has extremely aggressive cookie expiration policies, expiring these cookies after 24 hours (and in some cases 7 days)

Let's walk through a common user flow scenario to see how this works.

  1. A user clicks your add in a Google search result at 9AM Monday morning
  2. The user returns Tuesday afternoon to make their purchase
  3. Result: The purchase goes unattributed. It looks like this user is a direct visitor to your site with no ad interactions, not only in Google Ads, but also in Google Analytics.

πŸ“˜

Note that if a user visits within the 24 hour period after the cookie has been set, it will be refreshed for another 24 hours. In this scenario, a gap of 24+ hours is required for the cookie to expire.

There are many scenarios that cause problems. Another one to note is if your site is opened in a web view in Safari (this is the in app browser that pops up in some apps). Cookies do not transfer from the web view to the user's device browser. So another scenario might be

  1. A user clicks your ad on Instagram
  2. The ad is opened in a web view (inside of Instagram)
  3. The user browses, then closes this browser and goes back to Instagram
  4. They later decide to visit your site, and open up the Safari (or Chrome) app, and make a purchase
  5. Result: The purchase goes unattributed. The cookie used to connect the Instagram ad click to the purchase is not available in the users' browser

Cookie Expiry

Cookies expire within 24 hours when ALL of the following conditions are true

  1. The cookie is set with Javascript (I.e. not set from the server) If you're wondering whether your cookies are server set, it's unlikely.

  2. The site where the user came from has been classified by Apple as "having cross-site tracking capabilities". You can assume that all major ad networks are classified this way. Google, Facebook, Klaviyo, etc... Interestingly this is not a set list but a dynamically generated list on each users device.

  3. The link used from the ad click has url parameters (mysite.com?gclid=test) or fragments (mysite.com?#utm_source=test). You can safely assume that all of your ad click URLs have at least some of these parameters.

Local Storage Expiry

Local Storage is another browser mechanism that allows sites to save data associated with a session. Although Local Storage does not have the same 24 hour expiry that can occur with cookies, it is limited to 7 days in similar scenarios, and most advertisers, as of today aren't using the mechanism.

You can read more about WebKit's cookie expiration on Apples website