Migrating from CookieHub v1

CookieHub v2 was released on April 1st 2020. It’s a major update with new features including cookie scanning, automatic cookie declaration, brand new design, more languages, just to name a few.

CookieHub v1 is currently sunsetting and will be closed permanently on May 1st 2021. Websites still using v1 after that time will experience issues and may loose analytical information and more details handled by tags controlled by CookieHub.

You cannot access CookieHub v2 through your current v1 account and you’ll have to create a new account and manually create each domain in the new portal.

CookieHub v2 includes same events, methods and properties for backward compatibility and making the migration easy.

Cookie categories

In CookieHub v1 you could create custom cookie categories for each widget, however this is not possible in the latest version. This is done improve consistency across the platform and make implementing to 3rd party systems more streamlined.

In CookieHub v2 there are 5 categories available that you can customize:

Name ID Purpose
Necessary necessary Containing necessary cookies that are required to provide core functionality.
Preferences preferences Cookies not absolutely necessary but may improve the user experience without tracking behavior or personal information.
Analytics analytics Containing cookies that track user behavior and user to report information on the web site’s usage.
Marketing marketing Containing cookies used to provide personalized advertisements.
Other uncategorized Any other cookies not suitable for the other 4 categories.

JavaScript implementation code

The javascript code used to implement CookieHub on your website has been changed slightly but it most cases you may be able to replace v1 code with the v2 and get everything running without further changes.

Inline javascript loading is unchanged from previous version and you may only need to change the cookie category id if you have created custom cookie categories in v1.

Instead of passing events and properties in the initialise constructor, they should be located in the cpm variable defined at the top of the v2 script but the syntax is unchanged.

Here’s an example of v1 code:

<script src="https://cookiehub.net/cc/abf21b51.js"></script>
<script type="text/javascript">
window.addEventListener("load", function() {
window.cookieconsent.initialise({
    onInitialise: function(status) {
        if (this.hasConsented('analytics')) {
        }
    },
    onAllow: function(category) {
        if (category == 'analytics') {
        }
    },
    onRevoke: function(category) {
        if (category == 'analytics') {
        }
    }
})
});
</script>

The new v2 code:

<script type="text/javascript">
var cpm = {
    onInitialise: function(status) {
        if (this.hasConsented('analytics')) {
        }
    },
    onAllow: function(category) {
        if (category == 'analytics') {
        }
    },
    onRevoke: function(category) {
        if (category == 'analytics') {
        }
    }
};
(function(h,u,b){
var d=h.getElementsByTagName("script")[0],e=h.createElement("script");
e.async=true;e.src='https://cookiehub.net/c2/9f2842b1.js';
e.onload=function(){u.cookiehub.load(b);}
d.parentNode.insertBefore(e,d);
})(document,window,cpm);
</script>

Still need help? Contact Us Contact Us