Integrate Hubspot

How to setup Hubspot with TRUENDO in Google Tag Manager

Some services might need some extra attention to be set up properly. Hubspot is one of these cases. In order to use Hubspot properly we have to let it set its cookie but only allow tracking if the User consents to it. There are only a few steps to follow.

  1. Go to the TRUENDO tag in the Tag Manager.
  2. Replace all the code with the following:
<script>
function TruendoCookieControlCallback(cookieObj) {
  if (cookieObj.preferences) {
     dataLayer.push({'event':'truendo_cc_preferences'});
  }
  if (cookieObj.marketing) {
    dataLayer.push({'event':'truendo_cc_marketing'});
  }
  if (cookieObj.statistics) {
    dataLayer.push({'event':'truendo_cc_statistics'});
    _hsq.push(['doNotTrack', {track: true}]); // Enable Hubspot tracking
  } else {
    _hsq.push(['doNotTrack']); // Disable Hubspot tracking
  }
  if (cookieObj.social_content){
    dataLayer.push({'event':'truendo_cc_social_content'});
  }
  if (cookieObj.social_sharing) {
    dataLayer.push({'event':'truendo_cc_social_sharing'});
  }   
}
</script>
<script async="" id="truendoPrivacyPanel" type="text/javascript" src="https://cdn.truendo.com/pc/app.pid.js" data-siteid="YOUR WEBSITE ID">
</script>
Important Note: Make Sure that your replace the data-siteid with the one of your domain. You can find your Site ID in your Console. Under Integration on the Integrate to Website tab.
  1. Add a standard trigger to your Hubspot tag. For example the All Pages trigger.