HubSpot has a free cookie banner you can show on your HubSpot pages, and on any other website that has the HubSpot tracking code installed.
Converly works with the HubSpot cookie banner, so visitors who accept advertisement cookies are tracked as normal and visitors who decline aren't tracked at all.
The only slight oddity is that HubSpot's banner can't hold back scripts you've added to the page yourself (HubSpot says so in its own documentation). So instead of the normal one-line Converly code, you paste a slightly longer version that asks HubSpot for the visitor's answer first. It sounds technical, but it's simply a copy and paste.
To set it up, follow the instructions below:
Installed Converly through Google Tag Manager?
Follow the Google Tag Manager guide instead. The steps below are for sites where the Converly code is pasted straight into the website.
Step 1: Make sure your HubSpot banner asks for consent
The first step is to check your HubSpot cookie banner is set up to ask visitors for permission. In HubSpot, go to Settings, then Privacy & Consent, then the Cookies tab, and make sure your banner is switched on for your website's domain. If your website isn't built on HubSpot, add it with Add external domain.
This only works on pages that also have the HubSpot tracking code installed, because that's what shows the banner.
Step 2: Find your site key
Next, grab your Converly site key. In Converly, click Install in the left sidebar. Your install code is shown at the top, and your site key is the part after key= (it starts with site_). Copy it somewhere handy.
Step 3: Replace your Converly code
The final change is to swap your normal Converly code for the version that waits for consent. Go to wherever you pasted your Converly code (your website's head code box, or the site header HTML in HubSpot), delete it, and paste this in its place:
<script>
var _hsp = window._hsp = window._hsp || [];
_hsp.push(["addPrivacyConsentListener", function (consent) {
if (window.__converlyLoaded || !consent.categories.advertisement) return;
window.__converlyLoaded = true;
var s = document.createElement("script");
s.src = "https://js.converly.io/v1/loader.js?key=YOUR_SITE_KEY";
document.head.appendChild(s);
}]);
</script>Replace YOUR_SITE_KEY with the site key you copied in Step 2, then save and publish your site.
Important: Make sure you delete the old Converly code. If it's still there, Converly will run for every visitor whether they accept cookies or not.
This code asks HubSpot for the visitor's answer as each page loads, and again the moment they make a choice, so Converly switches on straight away when they accept.
Step 4: Test it works
That's it! The final step is to test it, and it only takes a couple of minutes.
First, open a new incognito window (or private window) and go to your website. When the cookie banner appears, decline marketing cookies. Then submit a test entry through one of your forms.
Now open the Activity page in Converly. The test entry should NOT appear there, because Converly never ran for that visitor.
Next, close that window, open another new incognito window, and go to your website again. This time accept marketing cookies (or click accept all), then submit another test entry. Head back to the Activity page, and this time the test conversion should show up within a moment.
If both of those happen, your cookie banner is holding Converly back properly.
