ITP / First Party Cookies (EN)

Introduction

ITP, or Intelligent Tracking Prevention, is a Safari prevention method for tracking visitors to websites over long periods of time. The practical consequences are:

  • Third party cookies are blocked completely

  • First party cookies that are created in the browser are only valid for 7 days

  • Localstorage values disappear after 7 days of no interaction with the website

For more detailed information you can go to the official website and on Cookie Status you can validate which browser uses which prevention method.

Impact on Squeezely data

This has several consequences for the correct measurement of your visitors, for now only Safari visitors but in the future possibly more browsers. For all visitors without a userid (often the majority) you will only have 7 days of data in this profile before the cookie expires. And with a new cookie, you also get a new visitor profile.

By splitting users up per 7 days, you obviously lose a lot of individual data and personal recommendations, but the algorithm as a whole is also less accurate and the items you may like and recommended for you product sets will not function optimally.

Moreover, in cookies we also keep track of which personalisations someone has already seen, so that they don't see a personalisation more than once that was only meant to be seen once

The market share of Safari on desktops is not that big, but on mobile it is quite significant because of iPhones. Firefox also uses a prevention method, although this is less strict, a similar impact may be measured in the future

The most important rule from ITP for Squeezely is:

For first-party cookies set with JavaScript'sdocument.cookie API, maximum expiration is set to7 days.

This means that if you set a cookie independently of the browser, i.e. at the server level, this rule does not apply. This way you can set a long term expiration date and ITP will not override it. This means that you have to retrieve the cookie created by us and then write it at the server level with a new expiration date, for example two years. The relevant cookies are:

  • sqzllocal (the visitor's unique ID that we use to identify him in Squeezely)

  • sqzl_vw (information about which personalization was seen by the visitor and when)

Sample code

Please note that you will not be able to copy this code and it is dependent on your own environment, it is for illustration purposes only.

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 app.get('/', (req, res) => { // Haal bestaande cookies op let sqzllocal = req.cookies['sqzllocal']; let sqzlvw = req.cookies['sqzl_vw']; // Check of de cookie bestaat, zoja, overschrijf de cookie vanuit de server if (sqzllocal) { res.cookie('sqzllocal', sqzllocal, {domain: 'jouwdomein.nl', path: '/', secure: true, expires: new Date(Date.now() + 1000*60*60*24*365*2), }); } if (sqzlvw) { res.cookie('sqzl_vw', sqzlvw, {domain: 'jouwdomein.nl', path: '/', secure: true, expires: new Date(Date.now() + 1000*60*60*24*365*2), }); } res.render('index'); });