Part 1: Install Usercentrics CMP v2 manually to your Hubspot website
-
Log into your Hubspot account
-
On the navigation menu go to “Website” and then click the “Website pages” tab.
3. At the top right corner you have a “Settings” icon. Click this icon to continue.
4. Now under the HTML section, you can insert the script tag to apply for all pages. The code looks like the below, but with your own Settings-ID. Your Settings-ID is available in your Admin Interface.
In your Settings dashboard you can find your personal script with your Settings-ID under „Implementation“ (CMP v2).
Code for CMP Version 2
<script id="usercentrics-cmp" data-settings-id="XXXXXXXX" src="https://app.usercentrics.eu/browser-ui/latest/loader.js" async></script>
Copy your unique script from the Admin Interface under Implementation or replace “XXXXXXXXX” with your personal Settings-ID in the above relevant code example.
5. Click “Save”
Part 2: Blocking third party services
Third party services must be blocked before a user gives consent, such as Google Analytics. Use your DPS Scanner to find out which third parties you have and block third party services until a user gives consent. Here is the guide to block third party services manually: https://docs.usercentrics.com/#/browser-ui?id=implementation.
For automatically blocking various supported third party technologies, you can also use our Smart Data Protector - see here for more information and all supported technologies: https://docs.usercentrics.com/#/smart-data-protector.
Example: Google Analytics
Step 1: Add Google Analytics Code to Hubspot
Add your Google Analytics code to your Hubspot pages by going to General - Website Pages - Pages and paste your unique Google Analytics code under the HTML section, to apply for all pages.
Step 2: Adjust the Existing Google Analytics Script
Once the Usercentrics script has been integrated into your website, all existing scripts need to be customized. This step is mandatory to ensure scripts are only executed after a consent has been given.
Change script type – “text/javascript” becomes “text/plain”
To customize your scripts, two small adjustments are necessary. The first one refers to the script type. Change the type from type="text/javascript" to type="text/plain" in your scripts.
If your script does not explicitly specify type="text/javascript" as it can be interpreted by the browser without naming it, you still have to adjust it to type="text/plain".
This adjustment is mandatory to ensure the script is not automatically interpreted and executed by the browser when the page is called.
Assign a data attribute
The scripts of the data processing services that you‘re using need to be given a custom data attribute. It is used to connect to our Consent Management Platform and to query consents.
The syntax of this data attribute is data-usercentrics="Name Data Processing Service"
, where "Name Data Processing Service" corresponds to the exact name of the Data Processing Services you created in your Settings dashboard under "Data Processing Services".
As an example, we're going to adjust the Google Analytics script.
Here is the original script:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].g||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga')
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
<script>
Once adjusted, it becomes:
<script type="text/plain" data-usercentrics="Google Analytics">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].g||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga')
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
<script>
From now on, upon page load, the Google Analytics script will only be executed if your visitor has given consent to Google Analytics.
Repeat the steps above for any other party services you have.
For questions about third party services using Google Tag Manager, please see our documentation
here.
Comments
0 comments
Please sign in to leave a comment.