APIs & Integrations

alexquintly
Member

Control tracking and cookie setting from the outside via tag manager

We are hosting our website through the Hubspot COS and with the GDPR deadline coming up, our company is implementing a third party cookie consent solution (OneTrust). For this to work we need to be able to tell Hubspot somehow (e.g., via cookie), that it should not embed the HS analytics/tracking code. As a side note: We will implement the cookie consent manager with Google Tag Manager

Support gave me the hint to use the Hubspot cookie banner and then use CSS to hide it and emulate a button click, but that sounds really improvised to me and not really like a professional solution.

Does someone have an idea how this could be solved?

Thanks a lot for your help
Alex

5 Replies 5
MNorlander
Participant

Control tracking and cookie setting from the outside via tag manager

Also dealing with this. Using OneTrust in combination with WordPress and Hubspot Landing pages/blog.

I used this blog article:

How To Implement GDPR Cookie Consent Notification with Google Tag Manager -...

Learn how to install and configure a GDPR Cookie Consent Notification with Google Tag Manager and update your marketing tags accordingly + Get a GTM Recipe!


Think I saw another thread where someone recommended this, or if I just stumbled across the article when googling...
The standard recipe in that blog article suggests running HubSpot tracking Java Script only if OneTrust Cookie consent is given. As a side-effect it is not possible to track from where the website visitor came.

Beside this it seem to work on WordPress.

The HubSpot hosted blog and Landing pages (two different sub-domains) are different stories. Not sure how to treat that yet. Anyone have some advices?
My idea is to:

  • Try to hide or disable the cookie consent banner using
  • Find some injection point which allows me to run the Google Tag Manager Java script only for Landing pages and Blog pages. Dont know where yet...
  • Setup Google Tag Manager to set the necessary cookies for enabling disabling tracking.

A lot of new tools to digest, so progress is slow and lots of trial and error. Anyone else thinking along these lines, or are there better alternatives?

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Control tracking and cookie setting from the outside via tag manager

Hi @mattdev,

You can now manage cookies via the Tracking Code API:

Place do not track cookie

_hsq.push(['doNotTrack']); - Places the __hs_do_not_track cookie in the visitors browser, will will prevent the HubSpot tracking code from sending any information for the visitor.



0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Control tracking and cookie setting from the outside via tag manager

Hi @alexpeiniger & @Niklas_S,

Regarding cookies: HubSpot will update the default language for enabling cookies on HubSpot-hosted websites to reflect affirmative opt-ins, and make it possible to show different versions of the cookie consent message based on domains or specific URL paths that you specify.

Additionally, functionality will be added to the Tracking Code API to trigger cookie deletion. It's not finished yet, but stay tuned for updates on that front. Additionally, check out our GDPR Product Readiness page for details/updates on product changes related to GDPR:

GDPR | HubSpot Product Readiness Page

If you work with the personal data of EU citizens, you need to comply with GDPR by May 25th. Here's what we're building (and doing) to help.

0 Upvotes
matttunney
Top Contributor

Control tracking and cookie setting from the outside via tag manager

Is there any update on this? - I've been looking at cookiebot, however if a built function exists that'd be much better.

0 Upvotes
Niklas_S
Member

Control tracking and cookie setting from the outside via tag manager

Very relevant question. Dealing with the same issue at the moment.
Mixed hosting between Hubspot COS and another provider. Need to be able to control Hubspot cookies through Google Tag Manager on Hubspot hosted content.

Looking for a professional solution rather than a workaround/jury-rig.

0 Upvotes