GDPR

tjnauman
Member

Enabling / Disabling Tracking Script via 3rd Party Cookie Banner

SOLVE

Hello, 

 

My organization requires us to use a 3rd Party Cookie Management Tool (OneTrust). 

 

As a result, I'm looking to understand what is the best way to enable and disable the analytics tracking script via the OneTrust cookie banner. 

 

After consulting this article (https://developers.hubspot.com/docs/api/events/cookie-banner), our approach is to place the Do Not Track cookie by default via Google Tag Manager and then enable tracking via a GTM script that sets "_hsq.push(['doNotTrack', {track: true}]);" and then disable via a script that sets "_hsq.push(['doNotTrack', {track: false}]);"

 

Does this seem like an appropriate approach? Is there a better way?

1 Accepted solution
LMeert
Solution
Guide | Platinum Partner
Guide | Platinum Partner

Enabling / Disabling Tracking Script via 3rd Party Cookie Banner

SOLVE

Hi @tjnauman,

 

It is indeed the best way : add the do not track cookie by default and then remove it when the user approves the tracking through the One Trust banner.

 

Especially if you're on HubSpot CMS since you cannot remove the tracking script which is added to your pages by default.

 

Hope this helps !
If it does, please consider marking this answer as a solution 🙂

 

Best,

Ludwig

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

View solution in original post

2 Replies 2
LMeert
Solution
Guide | Platinum Partner
Guide | Platinum Partner

Enabling / Disabling Tracking Script via 3rd Party Cookie Banner

SOLVE

Hi @tjnauman,

 

It is indeed the best way : add the do not track cookie by default and then remove it when the user approves the tracking through the One Trust banner.

 

Especially if you're on HubSpot CMS since you cannot remove the tracking script which is added to your pages by default.

 

Hope this helps !
If it does, please consider marking this answer as a solution 🙂

 

Best,

Ludwig

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

kvonloesecke
Community Manager
Community Manager

Enabling / Disabling Tracking Script via 3rd Party Cookie Banner

SOLVE

Hi @tjnauman,

 

Thank you for reaching out to the Community!

 

I wanted to refer you to this related thread from the Developer's Forum regarding OneTrust Cookie Banner. 

 

I also wanted to add our subject matter experts to this conversation to see if they have any thoughts.

Hi @Teun@Anton@LMeert - Do you have any insight for @tjnauman regarding their approach to enabling and disabling the analytics tracking script?

Thank you!

 

Best,

Kristen


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