After creating a Cookie Saver setup, the next step in the installation process is to deploy the Cookie Saver scripts.
The two Cookie Saver service consists of two scripts:
- Preload script
- Configuration script (known as the "Tag Manager" script)
This guide explains how to deploy the Preload script, and gives an overview of how to deploy the Tag Manager script.
The Preload script ensures that your cookies are restored correctly; its deployment is straightforward. On the other hand, the Tag Manager script enables us to run our service on your website, and save your cookies. This script will need to be configured before deployment.
Please, deploy the Preload script before continuing with the Tag Manager.
You can find the Cookie Saver scripts under 'Script Instructions' in your account.
Cookies can be set, used and updated in various ways. In order to accommodate this, we are utilizing the Preload script. This is a very light-weight script that ensures all your cookies are up to date on every page load.
It is IMPORTANT that this Preload script is run before any Tag Manager code or any 3rd party vendor code is executed.
Copy the Preload script from your account and place it directly in your source code as high as possible in the <head> section.
Why is this important?
Many 3rd party scripts continuously update their cookies to extend the expiration. However, if this happens after the cookies have been extended by Cookie Saver, there is a risk that the original cookie will still be deleted after 1-7 days (due to ITP). This is why Cookie Saver creates backup cookies, and it is from these backup cookies that our Preload script restores the original cookies, before they are used by the 3rd party vendor libraries.
Tag Manager script
As mentioned, you will need to configure the Tag Manager script before deploying it. This depends on the platform that you use and the cookies you wish to save.
The deployment consists in:
1. adding the Tag Manager script to your tag manager (or directly in your source code);
2. configuring the script and adding the cookies that you wish to save.
Please, refer to the following guides for instructions on how to deploy: