To conclude the installation, you need to deploy the Tag Manager script. This consists of adding the script to your Google Tag Manager and configuring it.
This guide explains how to deploy the Tag Manager script on your website through Google Tag Manager without the use of the Cookie Saver GTM Tag Template.
Note: Before starting, please make sure the Preload script is in place. The Preload script is used to guarantee that your cookies are always up-to-date when the page loads.
The process
It is assumed that an existing Google Tag Manager implementation is in place on the website and configured as required: https://support.google.com/tagmanager/answer/6103696?hl=en.
1. Create Google Tag Manager tag
Once logged into your GTM container, create a new HTML tag by clicking "Tags" > "New" > "Custom HTML".
Give the tag a name, e.g. "Cookie Saver".
In the "HTML" field, insert the Tag Manager code that can be copied from your Cookie Saver account.
Select "All Pages" as the trigger and click "Save" to create the tag.
This is what the Cookie Saver tag should look like with the Tag Manager script (the cookies will be added in the next step).
2. Configure, add cookies and deploy
Immediately following the Tag Manager script, initialize, add your cookies and start the service.
If you need only a very basic configuration, please, check out our ready-for-use quick start code. Otherwise, we recommend you to proceed as described.
First, Cookie Saver should be configured to your domain (initialization). In most cases, the following will suffice:
acq("init", { "endpoint": "INSERT ENDPOINT" });
Where:
- "endpoint" is the NS domain that you have chosen to use with Cookie Saver (e.g. for cookiesaver.io we have chosen to use fpc.cookiesaver.io).
More information on the initialization can be found here.
At this point, cookies can added one-by-one. In most cases it is enough to add the name of the cookie and the wanted expiration.
acq("addCookie", { "name": "INSERT COOKIE NAME", "expirationDays": INSERT EXPIRATION DAYS });
Where:
- "name" is the exact cookie name (e.g. for Google Analytics its "_ga")
- "expirationDays" is the wanted expiration in days. E.g. for Google Analytics its two years, equal to 730 days.
If you are struggling with this step, you can read more about different configuration possibilities when adding cookies.
If you have no idea about which cookies to save, you can start by identifying which cookies that have been affected by ITP. You can also read more about how to configure and add platform-specific cookies. E.g. Google Analytics cookies, Facebook cookies, and Google Ads cookies.
Lastly, after you added the cookies that should be saved, the script should be started by adding the following:
acq("start");
Complete example
This is what a complete configuration can look like when including cookies for Google Analytics (_ga), Adobe Analytics (AMCD_DE7...), Facebook (_fbp, _fbc) and our Cookie Consent.
What´s next?
Congratulations! You have now completed the installation and should have Cookie Saver up and running.
Validation
As a last step, you may want to check that everything is working correctly and implemented lawfully. To do so, please, visit the Validation section.
Comments
0 comments
Please sign in to leave a comment.