The first thing you need to after adding the Tag Manager script to your website is to initialize it properly.
This guide will explain how to initialize the script so that Cookie Saver is configured to your domain. It covers both basic and more advanced instructions.
Please, beware of the httpsOnly flag if your website is reachable through HTTP.
Basic
This is done with the following script:
acq("init", {
"endpoint": "INSERT ENDPOINT"
});
Where:
- "endpoint" (string) is the subdomain to your website that you have chosen to use with Cookie Saver (this is the subdomain that you created an NS record for)
Example for our website "cookiesaver.io":
acq("init", {
"endpoint": "fpc.cookiesaver.io"
});
Advanced
This is done with the following script:
acq("init", {
"endpoint": "INSERT ENDPOINT",
"domain": "INSERT DOMAIN",
"safariOnly": INSERT VALUE
});
Where:
- "endpoint" (string) is the subdomain to your website that you have chosen to use with Cookie Saver (this is the subdomain that you created an NS record for)
- "domain" (string) is the root domain for your website, e.g. for "support.cookiesaver.io" the domain value should be "cookiesaver.io". In some cases, you will need to set this manually, see below.
- "safariOnly" (boolean) is a default flag telling Cookie Saver for what browsers to run. Default is True (only run for Safari browsers). Setting this value to False will make Cookie Saver run for all browsers
Example (run for all browsers):
acq("init", {
"endpoint": "fpc.cookiesaver.io",
"domain": "cookiesaver.io",
"safariOnly": false
});
Manual setting
Manually setting the domain is in most cases not required (or recommended). But in special cases, you will need to set it if you don't own the root domain. An example of this could be that a provider hosts your website on a subdomain, e.g. your website domain is:
mywebsite.wordpress.com (assuming your website is hosted by WordPress).
In this case, you will need to set the "domain" attribute to "mywebsite.wordpress.com" as you want your cookies to be set on your own website domain and not "wordpress.com".
Comments
0 comments
Please sign in to leave a comment.