We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
May 13, 2022 2:42 AM
We would appreciate it if you could ask us about the cookie consent banner.
I think it is possible to set the banner display on the above page.
For example, our homepage can be given the following cookies.
・ HubSpot
・ A service
・ B service
Is it possible to control all cookies on HubSpot?
I have set it now, but when I click "Reject" on the banner, HubSpot cookies can be rejected, but "A service" and "B service" cookies are added.
I want to be able to reject all cookies when I click "Reject".
Solved! Go to Solution.
May 14, 2022 1:32 AM
Hey @sakashin ,
currently the cookie banner and the blocking of cookies with it only works with the native integrations like the ones with Google Analytics (https://knowledge.hubspot.com/website-pages/integrate-google-analytics-with-hubspot-content) or the Ad Pixels from Google Ads, Facebook and LinkedIn (https://knowledge.hubspot.com/ads/install-pixels-from-external-ad-networks).
If you have any additional services that you also want to block if consent is not given by the user, you can integrate them with the Google Tag Manager and integrate that with HubSpot natively here https://knowledge.hubspot.com/website-pages/add-the-google-tag-manager-code-to-your-pages
I should mention that this only counts for HubSpot Pages and not other pages that are not hosted with HubSpot.
Did that answer your question? If so, please help the community out by marking this as a solution, so other people with similar questions find it more easily.
Cheers,
Chriso
May 14, 2022 1:32 AM
Hey @sakashin ,
currently the cookie banner and the blocking of cookies with it only works with the native integrations like the ones with Google Analytics (https://knowledge.hubspot.com/website-pages/integrate-google-analytics-with-hubspot-content) or the Ad Pixels from Google Ads, Facebook and LinkedIn (https://knowledge.hubspot.com/ads/install-pixels-from-external-ad-networks).
If you have any additional services that you also want to block if consent is not given by the user, you can integrate them with the Google Tag Manager and integrate that with HubSpot natively here https://knowledge.hubspot.com/website-pages/add-the-google-tag-manager-code-to-your-pages
I should mention that this only counts for HubSpot Pages and not other pages that are not hosted with HubSpot.
Did that answer your question? If so, please help the community out by marking this as a solution, so other people with similar questions find it more easily.
Cheers,
Chriso
May 16, 2022 3:56 AM
Hey @Chriso-mwx
Thank you for your polite answer.
Can the above setting method be set even with a free plan?
May 16, 2022 4:08 AM
Hey @sakashin ,
not really, I'm afraid. Like I mentioned earlier, this only counts for pages that are hosted on HubSpot. So, you would need to have a Marketing Professional or CMS Plan for that.
When you would like to use the HubSpot Cookie Banner on your other webpages where you installed the HubSpot Tracking Snippet, you can do the following with the Google Tag Manager:
In the site <head>:
<script>
var _hsq = window._hsq = window._hsq || [];
_hsq.push(['addPrivacyConsentListener', function (consent) {
if (consent.allowed) {
// All of your codes go in here. You can place this wherever you want on your site, but the header is a common placement.
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','THIS IS WHERE THE GTM ID GOES');
}
}]);
</script>
Above </body> closing (doesn't change from the original)
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="[https://www.googletagmanager.com/ns.html?id=GTM-M3CZVPJ](https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXXX)"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Credit @IsaacTakushi
This way, the GTM only gets executed when the consent of the HubSpot Cookie Banner is given. I recommend checking this with the GTM Debugger.
Don't forget to change the GTM ID.
See this thread for more info:
https://community.hubspot.com/t5/APIs-Integrations/cookie-tracking-in-banner-with-GA/td-p/271193
Hope this helps,
Chriso
May 17, 2022 3:16 AM
Hey @Chriso-mwx
Sorry for asking so many questions.
I understand that the free plan does not allow control.
Does the code you gave me above need to be developed using the HubSpot API?
May 17, 2022 5:15 AM
Hey @sakashin ,
no, it's not that complicated at all. It just how you would implement your Google Tag Manager to any site. Tons of tutorials are out there. Like this one here:
https://developers.google.com/tag-platform/tag-manager/web
With the couple of lines of code enclosing the Tag Manager, it will only run when consent is given through the HubSpot Consent Manager.
Hope that clarifies your questions.
Cheers,
Chriso
May 17, 2022 2:49 PM
I see!
Thanks for the answer.
Setting up a cookie consent banner would require domain hosting, correct? (The domain of their website)