Shopify

How to implement Visible Privacy with Shopify.

Implementing Visible Privacy with Shopify

Visible Privacy helps you manage cookie consent and signal user preferences to Shopify's Customer Privacy API. This guide will walk you through the process of installing and configuring Visible Privacy on your Shopify store.


Prerequisites

Before beginning, ensure you have:

  • Access to your Shopify admin panel.
  • Your Visible Privacy Client ID (provided after onboarding).

Access the Shopify Code Editor

In your Shopify admin, go to Online Store > Themes. Click the Customize button for your current theme. Click the ••• button, then select Edit code.

Create a new Snippet

Under the Snippets section, click Add a new snippet. Name the new snippet visible-privacy-consent and click Create snippet. Open the new visible-privacy-consent.liquid file and add the Visible privacy script as content:

visible-privacy-consent.liquid
<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"/>

Save the snippet.

In theme.liquid, find the line: . Add this code directly under it:

theme.liquid
{{ content_for_header }}
{% render 'visible-privacy-consent' %}

Click the Save button.