Hey guys, got here a issue where we are using the Usercentrics CMP and hubspot to block hubspot tracking based on the consent given in the Usercentrics CMP.
So we call an window event that triggers whenever consent is interacted with, and if it is false - doNotTrack is set and if it is true - doNotTrack is set to track:true:
<script type=“text/javascript”>
var _hsp = window._hsp = window._hsp || [];
var _hsq = window._hsq = window._hsq || [];
window.addEventListener(“ucEvents”, function (e) { //ucEvents
// console.log(‘Consent Event fired’);
if (e.detail && e.detail.event == “consent_status”) {
// check for consent status of service “HubSpot”
if (e.detail[‘HubSpot’] === true) {
console.log(‘HubSpot has consent’);
_hsp.push([‘showBanner’]);
_hsq.push([‘doNotTrack’, { track: true }]);
console.log(“do not Track unset”);} else {
console.log(‘HubSpot has no consent’);
console.log(“consent is set to false”, e.detail)
_hsp.push([‘showBanner’]);
//_hsp.push([‘revokeCookieConsent’]);
_hsq.push([‘doNotTrack’]);}
} else {
console.log(‘no consent_status event’);
}
});
</script>
The ‘__hs_do_not_track’ cookie is set, but so are the other non essential tracking cookies like _hssrc. Is this normal? The cookies are set, but they are not tracking?