Implementing Cookie Saver without the use of a Tag Manager can be done in a few steps:
- Implement the Cookie Saver Preload script
- Add Cookie Saver script
- Configure, add cookies and deploy
1. Implement Preload script
The Preload script is used to guarantee that your cookies are always up-to-date when the page loads. More information and implementation instructions can be found under Preload script
2. Add Cookie Saver script
As high as possible in the <head> section, insert the Cookie Saver code, which can be copied from your Cookie Saver account. See Cookie Saver scripts The script is inserted after the Preload script.
3. Configure, add cookies and deploy
Before adding cookies, Cookie Saver should be configured to your domain. See Initialize: Endpoint and adv. settings
In most cases, the following will suffice:
acq("init", { "endpoint": "INSERT ENDPOINT" });
Where:
- "endpoint" is the CNAME domain that you have chosen to use with Cookie Saver (e.g. for cookiesaver.io we have chosen to use fpc.cookiesaver.io)
Cookies are added one-by-one. In most cases it is enough by adding a name and the wanted expiration days.
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)
More information about the different configuration possibilities when adding cookies can be seen here Add cookies to save them
After you have added the cookies that should be saved, Cookie Saver should be started by adding the following:
acq("start");
4. Validation (optional)
Cookie Saver comes with an automated way of validating your setup. See How to see your Cookie Saver setup is working
Comments
0 comments
Please sign in to leave a comment.