Setting up a cookie banner
Setting up a Cookie Banner with giosg¶
Notice
Features documented here are only available for giosg script v2. If you are using the giosg script v1, please contact giosg support for more details on how to upgrade.
Introduction¶
In this tutorial, we will be integrating a cookie banner on our webpages. To enable us to do this, we will be using two possible solutions: HubSpot Cookie Banner or Cookiebot. You will find the solutions to these down below.
HubSpot Cookie Banner¶
Setup HubSpot¶
When you have no HubSpot account available and would like to proceed with implementing the HubSpot cookie banner, you will need to create a new HubSpot account. Documentation regarding creating a new HubSpot account can be found here.
When the account is created or you already are in possession of a HubSpot account, we can go on with setting up the cookie policy and banner.
Setting the correct settings¶
When logged in, navigate to the HubSpot settings. The settings can be found on the right clicking the white ⚙️ as shown in the picture below.

When you enter the settings pages, you should click on Privacy & Consent that is located in the left sidebar. This should bring up the Privacy & Consent settings for HubSpot.

Warning
Before enabling the below step, please make sure you fully understand which GDPR settings will be toggled on by default! A full list can be found here.
When your organization is located within the European Economic Area (EEA), it is recommended to enable the EU General Data Protection Regulation (GDPR) settings that are located in this settings page.

Click on Consent Options and add proper content for all consents and privacy messages that will be included when using HubSpot.

Then click on Cookies, add a policy when none exists or alter existing Default policy. If you want more information on how to set up the cookie policy, follow the guide on HubSpot Knowledge Base
You will also want to click the policy label and activate the following three settings:
- Notify visitors that your site uses cookies;
- Require opt-in;
- Display cookies by category.
Then add the JavaScript to the page that is described below to enable the cookie banner.
Adding the required JavaScript on your site¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
You always want to let the user decide when and what cookies they want to accept/deny, you will want to add a button to your site to let the customers bring up the cookie consent bar again:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Cookiebot Cookie Banner¶
Cookiebot's Cookie Banner has multiple solutions one can implement to show their cookie banner on your website.
Warning
Be aware that ALL cookies are blocked unless given permission when the strictest mode is setup (GDRP Compliant), which is the default.
You can sign up or log in to your Cookiebot account, you will need to add the domain name(s) you want to include to Cookiebot CMP. These websites will be scanned for all cookies available.
When this is done, you can setup the cookie consent banner and widget that you would like to display on your website(s). To change the default cookie consent banner you can log in and go to Settings and Dialog.
The default banner is configured with the strictest settings possible (suitable for cookie consent under GDPR and ePR). You will also have to edit the default banner text so it fits the (legal) requirements for your organization.
When everything is set up, you will need to add two different scripts:
- Cookie consent banner, this script loads your banner and blocks any scripts that has not had explicit permission to load.
Note
Replace the 00000000-0000-0000-0000-000000000000 with your cookiebanner UUID.
1 2 3 4 5 6 | |
- The Cookie Declaration lists all cookies and trackers discovered by Cookiebot on your website and allows the user to withdraw (or change) a consent at any time.
Note
Replace the 00000000-0000-0000-0000-000000000000 with your cookiebanner UUID.
1 2 3 4 5 6 | |
When these two have been added and the scan of your website is complete, you can check your scan report in Cookiebot to see if there are any unclassified cookies. When there are unclassified cookies, add a short purpose description to those.
Manual marking cookies¶
Warning
When you want to change the classification of the existing scripts, you can also use the data-cookieconsent to those scripts to change the classification.
The last thing you will need to do on your own website when you want complete control over the consents and script loading on your site, is adding a data-cookieconsent to the scripts you have available on your pages. There is three cookie categories: preferences, statistics and marketing. You will also need to change the script type to text/plain from text/javascript to make sure they do not autoload. Cookiebanner will load these scripts for you.
An example of updating the existing Google Analytics Tag:
1 2 3 4 5 6 7 8 9 10 11 | |
Google Tag Manager (GTM)¶
A guide for adding this script to GTM can be found on the cookiebot support page.
Conclusion¶
In this tutorial we checked two different ways of adding a cookie banner to your own webpage.