Magento 2

How to implement Visible Privacy with Magento 2.

Implementing Visible Privacy with Magento 2

This guide explains how to install Visible Privacy™ Consent on your Magento 2 store.


Prerequisites

Before beginning, ensure you have:

  • Access to your Magento Admin panel.
  • Administrator privileges.
  • Your Visible Privacy Client ID (provided to you by Visible Privacy).

Installing the Visible Privacy Script

Log in to your Magento Admin panel. Go to Content > Design > Configuration.

Select Store View

Find the specific store view (or the global scope) where you want to add the script. Click Edit in the corresponding row.

Add Script to HTML Head

Scroll down to the HTML Head section. Locate the field labeled Scripts and Style Sheets. Paste the following script block into this field:

index.html
<script src="https://bc-prod-config.empathy.co/MerchantID/cookieBlacklist.js"></script>
<script src="https://bc-prod-config.empathy.co/blockCookieScript.js"></script>
<script src="https://bc-prod-config.empathy.co/MerchantID/customization.js"></script>
<script id="VisiblePrivacy" type="module" src="https://bc-prod-config.empathy.co/assets/index.js"></script>
<link rel="stylesheet" type="text/css" href="https://bc-prod-config.empathy.co/assets/index.css"/>

Replace Placeholder

In the pasted script, replace "MerchantID" with the actual Client ID provided to you by Visible Privacy. Important: Ensure you keep the double quotes around your Client ID.

Save Configuration

Click the Save Configuration button in the top right corner.

It's often necessary to clear Magento's cache for the changes to take effect. Go to System > Tools > Cache Management and refresh any invalid cache types, particularly Page Cache and Configuration.