Looking to implement OneTrust cookie banner solution on our Hubspot hosted site. These are some of the things that I am looking to get some answers to:
1) Is there a way to add Hubspot tracking cookies to Google Tag Manager
2) How to disable the Hubspot cookie banner without disabling the cookies themselves
3)Is there a way to enable/disable Hubspot’s cookies in a javascript function instead of interacting through the Hubspot cookie banner
hello @jerry13 !
Here are some resources for you
1. Install HubSpot tracking code via Google Tag Manager
You will need to scroll way down to bottom of page for GTM section
2. You can control the banner in the portal settings -- cookies. Here is a link reviewing the cookies
3. Here is an example of removing cookies via a js function
Here’s hoping this leads you in the correct direction!
Hi, thanks for the link to how to setup the tracking code in GTM. The banner also is disabled now via the portal. The only thing that is not working is removing the Hubspot cookies from the site. I tried including the javascript in the link you sent in the template of my page, but I’m not sure what is being blocked. I still see a bunch of cookies being set from app.hubspot.
Hey @jerry13 ,
Glad we are two-thirds there. 
Could you provide a link to where you have added that code?
Did you copy the code exactly, if so, does your button have the id
removeCookies
Hi @dennisedson ,
This is the test site that I am working on https://services.test.businesswire.com/ .
I put it in the head tag of the page in a script on line 35. Also I removed the function call as I just want it to do it on every page load. What I am going for is basically disabling the Hubspot innate banner and cookies and put those in Google Tag Manager instead.
Hey @jerry13 ,
I think the next option is this.
You will need to update that code example to fire without needing a button click, but that should work.
Please test (obviously) and let us know if that worked for you
Best of luck!
@dennisedson
I included both those calls in the script already without an onclick function so it should just fire whenever page loads, but they are currently still not disabling the Hubspot cookies.
hey @jerry13 !
Was looking at your site and it looks like you use a
p
instead of a
q
in the code. It should be:_hsq.push(['doNotTrack'])
I tested in the console and it set the
hs_do_not_track
cookie to yes
Hi @dennisedson ,
I changed it back to “hsq” but I still see hubspot cookies being set in my browser.
hey @jerry13 , apologies for delayed response.
I think it may be firing too quickly. Can you write it like this
$(window).load(function(){
var _hsp = window._hsp = window._hsp || [];
_hsp.push(['revokeCookieConsent']);
_hsq.push(['doNotTrack']);
})
Thanks!