Blog, Website & Page Publishing

sakashin
Participante

about the cookie consent banner.

resolver

We would appreciate it if you could ask us about the cookie consent banner.

https://knowledge.hubspot.com/jp/reports/customize-your-cookie-tracking-settings-and-privacy-policy-...

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".

0 Me gusta
1 Soluciones aceptada
ChrisoKlepke
Solución
Asesor destacado | Partner nivel Elite
Asesor destacado | Partner nivel Elite

about the cookie consent banner.

resolver

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

Ver la solución en mensaje original publicado

7 Respuestas 7
ChrisoKlepke
Solución
Asesor destacado | Partner nivel Elite
Asesor destacado | Partner nivel Elite

about the cookie consent banner.

resolver

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

22tb
Miembro

about the cookie consent banner.

resolver

Hey Chriso,

 

you've mentioned "this only counts for HubSpot Pages and not other pages that are not hosted with HubSpot."

 

I do have a website with two subdomains:

  • abc.example.com (hosted on Hubspot)
  • def.example.com (hosted on WordPress - Hubspot Plugin being installed there)

I'm also usting the Hubspot GTM integration which is automatically linked to the Cookie consent bar. The behavior on Hubspot Pages (abc.example.com) works fine.

 

But this doesn't seem to work for the external WordPress pages (def.example.com) - even though the Hubspot Tracking Tag is inserted via the WP plugin. That's surprising because the official support article says "This feature works for all HubSpot pages as well as any external pages with your HubSpot tracking code installed."

 

So, it seems like the only way around this is to hard code GTM in all Hubspot/WordPress templates and to put a firing rule in place, which is listening to the user consent.

 

Would you agree? Thanks

0 Me gusta
sakashin
Participante

about the cookie consent banner.

resolver

Hey @ChrisoKlepke 

Thank you for your polite answer.

Can the above setting method be set even with a free plan?

ChrisoKlepke
Asesor destacado | Partner nivel Elite
Asesor destacado | Partner nivel Elite

about the cookie consent banner.

resolver

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

sakashin
Participante

about the cookie consent banner.

resolver

Hey @ChrisoKlepke 

 

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?

0 Me gusta
ChrisoKlepke
Asesor destacado | Partner nivel Elite
Asesor destacado | Partner nivel Elite

about the cookie consent banner.

resolver

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

sakashin
Participante

about the cookie consent banner.

resolver

I see!
Thanks for the answer.

Setting up a cookie consent banner would require domain hosting, correct? (The domain of their website)

 

sakashin_0-1652813372498.png

 

0 Me gusta