In this doc, we'd like to show you how to use HubSpot with the help of our cookie plugin.
In IBorlab's Cookie you will already find a pre-built cookie template for the HubSpot service. This means that you don't need the Hubspot plugin. Please deactivate it before installing Borlabs Cookie.
HubSpot Cookie
Step 1: Add Hubspot Cookie
To be able to use Hubspot via Borlabs Cookie, first create a cookie. For this purpose, we provide you with a HubSpot cookie template.
In the backend, go to the "Cookies" menu item and then click on the "Add new" button in the Marketing cookie group.
Under Service, select our Hubspot Cookie Template and click "Next":
You will now be taken to the cookie settings.
Step 2: Hubspot Cookie Settings
In the Hubspot cookie settings, scroll down to "Additional settings" and enter your Hub ID.
Now just click on the "Save all settings" button and the Hubspot setup is complete.
Hubspot Formular
To use the Hubspot form with our cookie plugin, you need to follow the steps below.
Step 1: Create Hubspot Content Blocker
Go to the "Content Blocker" menu item in the backend and click on the "Add new" button.
Step 2: Hubspot Content Blocker Settings
Now enter the following data here:
ID: hubspot
Status: ON
Name: HubSpot
Privacy Policy URL: https://legal.hubspot.com/privacy-policy
Host(s): hubspot-avatars.s3.amazonaws.com, *.hubspot.com, hubspot-realtime.ably.io, hubspot-rest.ably.io, js.hs-scripts.com
After that click the "Save all settings" button.
Step 3: HubSpot Content Blocker Shortcode
After saving, a Content Blocker shortcode is generated. We need this code for our HubSpot form.
Step 4: Use and customize form script
Now go to the page where you want to insert your Hubspot form.
Then copy the following script:
<script src="//js.hsforms.net/forms/v2.js" charset="utf-8" type="text/javascript"></script>
<script>
window.BorlabsCookie.callWhenLoaded('hbspt', function () {
window.setTimeout(function () {
hbspt.forms.create({ portalId: 'YOUR-PORTAL-ID-HERE', formId: 'YOUR-FORM-ID-HERE'});
}, 3000);
});
</script>
You only need to add your Portal ID (YOUR-PORTAL-ID-HERE) and your Form ID (YOUR-FORM-ID-HERE) to the script.
Also, put the content blocker shortcode from step 3 around the script. The whole thing should look like this:
Your Hubspot form should be blocked afterwards with the help of Content Blocker.
https://borlabs.io/kb/9-unblocking-content-blocker-by-consent-borlabs-cookie/