PART 1: Install Usercentrics to your Shopify website
Log into your Shopify account
On the navigation menu select “Online Store” and then “Themes”
Hover over your Current Theme and select “Actions” then “Edit Code” so that the code editor appears
In the code editor under “Layout” select theme.liquid
In the <head> section of this code simply past your Usercentrics script with your unique Settings-ID. 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).
Copy your unique script from the Admin Interface under Implementation or replace “XXXXXXXXX” with your personal Settings-ID in the above relevant code example.
6. Click “Save”
PART 2: Manually Blocking Your Third Party Services
Do you have third party services, such as Google Analytics? If you are unsure, you can find out by using our DPS Scanner in your Admin Interface.
If you have third party services, you will need to block each of them until a user gives consent. In order to block third party services and cookies until the user has given consent, you will need to follow the steps below for each third party.
Using Google Analytics as a third party service example, you can follow the steps below:
Step 1: Add Google Analytics Code to Shopify
Add your Google Analytics code to the header section of the layer theme.liquid, like done with Part 1 for the Usercentrics-script.
(Navigate to Shopify - Themes - Current Themes - Actions - Code Editor - Layers - theme.liquid)
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.
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:
Once adjusted, it becomes:
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 third party services you have.
For questions about third party services using Google Tag Manager, please see our documentation here.