CookieHub on multiple domains/hosts
Sharing consents between hosts
CookieHub is configured by default to share consents between all host within a single domain. Meaning that if a user enters www.example.org for the first time, he'll get the CookieHub widget asking for consent. If the user then enters another host within the same domain (ex. shop.example.org) and the same widget code is loaded there, the user won't see the CookieHub widget again since he has already consented.
If you want to crawl hosts and include the cookies detected there in the cookie declaration, you can add the hosts in the Sub domains section in the Scans tab.
Don't share consents between hosts
If you want to load different CookieHub widget code on different hosts within the same domain in order to customize the user interface or functionality, you'll have to make minor modifications to the code to tell CookieHub how to store the user's choices.
The default CookieHub widget code looks like this:
<script type="text/javascript"> var cpm = {}; (function(h,u,b){ var d=h.getElementsByTagName("script")[0],e=h.createElement("script"); e.async=true;e.src='https://cookiehub.net/c2/xxxxxxxx.js'; e.onload=function(){u.cookiehub.load(b);} d.parentNode.insertBefore(e,d); })(document,window,cpm); </script>
Change the cpm object to include empty cookie domain:
<script type="text/javascript"> var cpm = { cookie: { domain: '' } }; (function(h,u,b){ var d=h.getElementsByTagName("script")[0],e=h.createElement("script"); e.async=true;e.src='https://cookiehub.net/dev/c2/xxxxxxxx.js'; e.onload=function(){u.cookiehub.load(b);} d.parentNode.insertBefore(e,d); })(document,window,cpm); </script>
The value of the domain property must be empty and it will instruct the browser to set the cookie on the current domain instead of the top level domain which is the default value.