CMS Development

matttunney
Contributeur de premier rang

Google tag manager cookie consent issue

Hi

 

I'm seeing an issue with hubspot tracking via google tag manager.

 

The issue seems to be that a visitors cookie consent only sends tracking data on any additional page views, meaning visitor data from the first page (such as source and refererrer) is lost and the visitors attibution subsequently gets set to direct.

 

This is my custom tag in tag manger with if fired on all pages:

<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/262138.js"></script>
<!-- End of HubSpot Embed Code -->
<script>
  var _hsq = _hsq || []
  
  if({{hubspotDoNotTrack}} !== 'false' ) {
    _hsq.push(['doNotTrack', {
      track: true
    }]);    
  } else {
    _hsq.push(['doNotTrack']);
  }  
</script>

The tag manager variable `{{hubspotDoNotTrack}}` is set based on the value of a first party cookie.

 

Is it possible to correct this so as soon as a visitor clicks accept, the hbspot tracking updates to record thte initial page view?

 

 

0 Votes
2 Réponses
ziadi
Contributeur

Google tag manager cookie consent issue

Hi Matt, any updates on this? 

0 Votes
sharonlicari
Gestionnaire de communauté
Gestionnaire de communauté

Google tag manager cookie consent issue

Hey @matttunney 

 

I apologize for the delay response. I am wondering if you still have questions regarding this post.

I was investigating and I found this article created from our developers related to privacy consent status. Have you tried any of the suggestions made there? 

 

Thank you 
Sharon


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




0 Votes