Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ITP Avoid Extension Configuration

ITP Avoid module was created for avoiding the Safari Intelligent Tracking Prevention protocol. ITP protocol targets cookies that are set by plain
JS via document.cookie (all tracking scripts) in order to avoid restrictions we have developed a module that "catches" cookies that we do nopt
want to be deleted by ITP and sets it back from the server-side

Summary: we want some specific cookies that are set with document.cookie to be re-set from the serverside

BE settings:

Text input field for cookie names


Text input for the cookie domain

Interceptor Script: https://www.npmjs.com/package/cookie-interceptor

Module Workflow

1. A cookie is set via document.cookie


2. Interceptor.js “catches” cookie
3. Interceptor.js compares cookies’ name & domain to the values specified in BE settings
a. If name or domain does not match the ones specified in the BE settings
i. Interceptor.js ignores this cookie
ii. A cookie is set as usually
b. If name and domain match BE settings
i. Interceptor.js blocks this cookie
ii. Interceptor.js sends this cookie to the server
iii. The server sets the cookie as it was meant to be set via document.cookie
c. if name matches and the domain name is empty
i. Interceptor.js blocks this cookie
ii. Interceptor.js sends this cookie to the server
iii. The server sets the cookie to the domain specified in BE settings

Configuration
As you may see - not many fields to configure:

1. Cookie & domain list -


a. names of cookies that you would like to keep from ITP, comma-delimited if you want to catch cookies without specific domain
(e.g. ga,gid,)
b. name of cookie & domain name if you want to catch a cookie for specific domains (e.g. _ga:scandiweb.com,
2. Root Domain - a domain where cookies without domain specified will be written to. insert domain without http:// or https:// and a trailing
slash "/"

Example of Configuration

1. Navigate to the page of the domain that you would like to configure the extension for
2. Open developer tools
3. Navigate to "Application Tab"
4. Navigate to "Cookies" section
5. Select the domain that you are interested in
6. Find cookie names that you are interested in
7. Go to the BE
8. Navigate to the admin menu
9. Navigate to the "Scandiweb" tab
10. Navigate to the "ITP Avoid" extension
11. Enable the extension
12. Populate "Cookie List" field in the BE settings with the names of cookie
13. Populate "Root Domain" field in BE settings
14. Save changes
15. Navigate to the "System" menu
16. Navigate to the "Cache Management" menu
17.
17. Select "Configuration" & "Page Cache" items
18. Refresh those
19. Go to the FE
20. Open developers tools
21. Navigate to the "Network" tab
22. Do hard refresh ("command + shift + r" on Mac)
23. Trigger the script that you did configure cookies for
24. Filter network requests by name "setCookie"
25. You should see requests there if you have configured everything correct
26. In the "Preview" tab of the request, you should see all the cookie data

Request Example:

You might also like