Cookie Expiry in WebKit/Safari Browsers
Learn about how Apple's ITP aggressively expires advertising data in Safari (WebKit) based browsers causing signification tracking issues
Overview
Tracking Issues:
Marketing technologies utilize cookies (and Local Storage) to correlate user ad clicks with conversions. Let's examine a straightforward scenario: A user clicks on your Google Ad and is directed to your website. Upon arrival, your Google Ads tracking tag seamlessly stores an identifier known as a "gclid" in a cookie within the user's browser. Then, when the user completes a purchase on your site, the Google Ads tags automatically retrieve the value stored in this cookie and transmit it to Google. Google Ads then analyzes this value, linking it back to the original ad click, and attributes the sale initiation to that specific ad click. This process ensures accurate crediting of ad clicks for sales on your site, portraying favorable performance metrics for your Google Ads campaigns.
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.
Common User Flow Scenarios:
- Scenario: A user clicks your add in a Google search result at 9AM Monday morning. The user returns Tuesday afternoon to make their purchase
- 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.
- Scenario: A user clicks your ad on Instagram and the ad is opened in a web view inside of Instagram. The user browses, then closes this browser and goes back to Instagram. Later they decide to visit your site, and open up the Safari (or Chrome) app, and make a purchase.
- 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
- The cookie is set with Javascript (e.g. not set from the server). If you are wondering whether your cookies are server set, it's unlikely.
- 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 (e.g. Google, Facebook, Klaviyo). Interestingly, this is not a set list but a dynamically generated list on each users device.
- 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 Apple's website
Updated 5 months ago