Multiple domains from single CMS

Have more questions? Submit a request

If you use a multisite CMS system like Typo3, Wordpress Multisite or Magento and you do not have the ability to set up scripts for the separate domains you need to modify the embed script if you have multiple domains connected. 

 

Use the following script as an example to setup 3 domains:

 

<script>

var hostname = window.location.hostname;

var script = document.createElement("script");

script.src="https://consent.cookiefirst.com/banner.js";

// use domain.com, without https://

// to get correct value, take the output of window.location.hostname in dev tools on that domain

if(hostname === 'domain1.com') {

script.setAttribute('data-cookiefirst-key', "API KEY HERE");

}else if(hostname === 'domain2.com') {

script.setAttribute('data-cookiefirst-key', "API KEY HERE");

}else if(hostname === 'domain3.com') {

script.setAttribute('data-cookiefirst-key', "API KEY HERE");

}
document.head.appendChild(script);

</script>

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share