GDPR

anhorvat
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hello everyone,

I am seeking help regarding the implementation of 3rd party cookie tools on HubSpot. 

Some part of our website is on WordPress, but our Landing Pages and the Blog is on HubSpot. I need a cookie tool for both content management systems and I figured out that the best 3rd party cookie tools are Onetrust and Cookiebot. 

The question is - which one would you recommend implementing and how?
I did not find any best practices neither on HubSpot nor on the providers' website. 

Any tips for someone who has no big technical background? I would very much appreciate it.

Thank you in advance.

Regards,

Anett

14 Antworten
thompsonsj
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

I face a similar issue. The challenge in implementing third-party cookie consent models is that HubSpot don't provide enough ways to interact with the way they set cookies. As a result, it's impossible to set HubSpot cookie behaviour based on cookie categories selected in a third-party tool. See https://community.hubspot.com/t5/APIs-Integrations/Creating-a-custom-cookie-consent-bar/m-p/263554.

 

I still want to use third-party cookie consent though - if you share the same subdomain across HubSpot and non-HubSpot web properties, then it makes sense to manage cookies in one place. i.e. if a user consents to cookies on a HubSpot page, that consent should also be applied on non-HubSpot pages under the same root domain.

 

So far, it only seems possible to set an additional cookie to tell HubSpot not to track users if they haven't consented to cookies. I wrote the following script for OneTrust, which watches for changes to cookie consent in the OneTrust cookie banner, and then removes HubSpot tracking cookies and sets the HubSpot 'do not track' cookie if 'performance/analytics' cookies have not been accepted. It will also remove the 'do not track' cookie if consent is reactivated. Removing HubSpot cookies in this script could be left out - they get set again on subsequent page visits! However, at least the 'do not track' cookie prevents HubSpot tracking code from sending data.

 

Note that Cookiefirst also have a similar solution: https://support.cookiefirst.com/hc/en-us/articles/5080576655505-Hubspot-Integration

 

 

<script>
"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

var performanceCookieCategory = 'C0002,';

function waitForOneTrust() {
  hasOneTrustLoaded();
  var attempts = 0;
  var interval = setInterval(function () {
    if (hasOneTrustLoaded() || attempts > 100) {
      clearInterval(interval);
    }

    attempts++;
  }, 100);
}

function hasOneTrustLoaded() {
  if (typeof window.OnetrustActiveGroups === 'string' && _typeof(window.OneTrust) === 'object') {
    optanonWrapper();
    return true;
  }

  return false;
}

function optanonWrapper() {
  window.OneTrust.OnConsentChanged(function () {
    var _hsp = window._hsp = window._hsp || [];

    var _hsq = window._hsq = window._hsq || [];

    if (!window.OnetrustActiveGroups.includes(performanceCookieCategory)) {
      _hsp.push(['revokeCookieConsent']);

      _hsq.push(['doNotTrack']);
    } else {
      _hsq.push(["doNotTrack", {
        track: true
      }]);
    }
  });
}

(function () {
  waitForOneTrust();
})();
</script>

 

kvlschaefer
Community-Manager/-in
Community-Manager/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Thanks for sharing, @thompsonsj!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
SHershey
Mitglied

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi Everyone,

I'm rather sure I read all threads about using a third party cookie consent banner with HubSpot but I still haven't found the correct answer. This thread comes closest but not quite. We are using DSGVO Pro on our German WordPress website. To add Hubspot to the cookie banner, it asks for jQuery/Javascript for accepting and for declining the cookies. Do any of you know where to find that script? I am not a developer and need to solve this on my own at the moment. Any help would be much apprechiated.

Many thanks,

Sarolta

 

Screenshot 2021-02-19 at 10.11.38.png

0 Upvotes
kchung
Mitglied

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi Everyone,

 

We are using the OneTrust cookie agreement and have inserted the snippet of code into the <head> of the global setting's Website>Pages section. Works fine.

 

The problem is mostly in the Hubspot editing backend:

1) the Cookie notice bar keeps appearing within the editing area - even after you accept or reject the cookies. And its annoying.

2) the Hubspot editing icon (which appears on the top-right corner of every page when viewing through a browser to access editing tools) is not displayed.

 

Is there a fix to using third-party cookie agreement code? We want to keep using OneTrust as we are fairly invested into it.

SimonS
Stratege/Strategin | Elite Partner
Stratege/Strategin | Elite Partner

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi Anett,

 

We're using Cookiebot which I find very easy to use. Even as a non-techie...

 

About implementing

Cookiebot needs to be configured for the different cookie categories that you want to set. Out of the box it suggests 4 categories which pretty much covers most of the neccessary cookies. Maybe you'll drop or add one.

Per category you'll be able to describe in your own words what they do and how you'll be using the cookies.

Next you design your consent banner and decide where and when you want it to show up.

Cookiebot delivers a script that you'll need to implement on the pages of all the domains/subdomains that you're using.

You configure that in GTM where you also configure the cookie setting based on the results of the consent banner. For instance: category Marketing = True -> GTM will set all applicable cookies of that category.

 

Hope this helps!

 

Best,

Simon

JessicaH
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi @anhorvat,

 

Thanks for reaching out.

I want to tag in some thoughtleaders to see if they have some suggestions.

 

Hi @MatthewShepherd @RaviT @GregBrown @SimonS, do you have any thoughts on this?

 

Thanks!

Jess 


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, in dem du deine Spracheinstellungen änderst !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes
RaviT
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi @anhorvat,

 

We are using OneTrust. We are only doing one cookie preference center for all of our HubSpot pages. We are defaulting to a preference center v banner because it allows for the user to choose between the different cookie categories. We were able to do this out of the box, with no additional cost or coding.

 

One thing to note about OT, is that any publish can take up to 4 hours. So you have to have patients to see live changes. 

 

I have heard good things about Cookiebot too but have not used it.

 

Hope this helps,

Ravi

anhorvat
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi RaviT,

Thank you for your reply. Can you send me a link to your website so I can see what you are describing here?

Did I understand it correctly - you've implemented the cookie preference banner on your HubSpot sites. How did you do that without additional coding? 

Best,

Anett

0 Upvotes
RaviT
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

@anhorvat -

 

Please see below for our site:

https://hub.kearney.com/take-5-sign-up

 

This is the code (provided by OT) we used to show the cookie preference center vs the banner:

<!-- OneTrust Cookies Consent Notice start -->

<script type="text/javascript" src="https://cdn.cookielaw.org/consent/XXXX.js"></script>
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="XXX"></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>


<script type="text/javascript">
//functions to hide banner and show preference centre
var consent = false;
function OptanonWrapper() {
setTimeout(function(){
if (!getCookie('OptanonAlertBoxClosed') && consent == false) {
consent = true;
Optanon.ToggleInfoDisplay();
var banner = document.getElementById("onetrust-banner-sdk");
banner.style = "display: none;";
}
}, 1000)
}
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) {
return true;
}
}
</script>

<!-- OneTrust Cookies Consent Notice end -->

 

Let me know if this helps,

Ravi

SJoshi1
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi @RaviT, I am fairly new to HubSpot, and this might sound like a dumb question, but where do I need to paste this code? Do I need to create a custom module for a header or a footer? and then use the module on the landing page? 

0 Upvotes
RaviT
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi-
We no longer have HubSpot, otherwise I would screen shoot it for you. We put it in the header section, I think its in the admin section where you can add it. If you use google tag manager and have that running on HS it can be put at the same place you put that within Hubspot.
SJoshi1
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi @RaviT, Thanks for the reply. Would it be here? No. we have not yet connected Google Analytics since it's just the beginning of the implementation for us.OneTrust ss.jpg

MMalloy
Mitglied

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi Ravi - as a OneTrust user too (though we're going the cookie banner route) - I'm curious if you've had issues with the OneTrust script causing issues in the HubSpot editor? My issue is that the acceptance banner comes up within the in-browser editor in HubSpot, and even though I'm able to click the 'I Accept', the grey background overlay never goes away, so I can't access the in-browser page editing tools. I'm curiosu to know if you've dealt with anything similar and if so, how you've worked around it?

 

I'm including a screenshot below of the editor with the greyed out screen that won't allow in-page editing. I'd appreciate any thoughts you, or any other thread viewers have. Thanks in advance!

 

Snip20200724_1.png

0 Upvotes
RaviT
Teilnehmer/-in

Any best practices on how to implement 3rd party cookie tools? (Onetrust, Cookiebot)

Hi  MMalloy-

 

We are not having that particular issue. We do have to choose our opt-in each time we make a change to a landing page or blog post. Not an issue on forms creation though. We have an open ticket with OneTrust on this issue. Hopefully, they will have a solution for us soon. If it seems like a universal solution, I will pass it along to you.

 

Thanks,

Ravi

0 Upvotes