Get Consent Banner Status - Cookie Policy for GDPR - Setup advice


#1

I've enabled the cookie banner via HubSpot; however, in order for this functionality to work,I need to be able to show that a person gave consent to being tracked on the website (the banner solution doesn't currently do this automatically). I have two questions:

A. Have I set this up correctly?

  1. Since the code is javascript, I created a new file module - and added the javascript code:

    // Log the consent status of the current visitor to the console

    _hsq.push(['addPrivacyConsentListener', function(consent) {
    console.log(consent.allowed);
    }]);

  2. I then accessed the public URL and referenced the public URL in the footer HTML for our HubSpot account

Note: I will also need to add this to our external site, so want to double check myself.

B. If this is correct, how do I then gain access to the consent status i.e. funnel a true/false into a contact property?

Documentation used:
https://developers.hubspot.com/docs/methods/tracking_code_api/tracking_code_overview



#2

Hi @Polly_Flinch,

Can you clarify what issue you're seeing? Are you running into errors trying to access a visitor's consent status? Everything you've described sounds correct to me, but I want to make sure I can address any questions/roadblocks you have directly.

For clarification, the HubSpot cookie banner will appear for your site visitors, and will automatically track cookie consent status, removing HubSpot tracking cookies appropriately. You don't need to do any additional work to put this cookie consent status into a contact property. If you're trying to use the HubSpot cookie banner to track consent for other cookies used by your site, you're correct that you'll need to obtain the visitor's consent status via the Tracking Code API.