---
title: How to set up Cookiebot with the Shopify Customer Privacy API
description: How to set up Cookiebot with the Shopify Customer Privacy API
---

[Skip to content](https://knowledge.profitmetrics.io/how-to-set-up-cookiebot-with-the-shopify-customer-privacy-api#main-content)

[![ProfitMetrics logo black version](https://knowledge.profitmetrics.io/hs-fs/hubfs/pm_logotype_blue.png?width=193&height=28&name=pm_logotype_blue.png)](https://knowledge.profitmetrics.io/?hsLang=en)

Open main navigation

Close main navigation

- [Contact Support](https://knowledge.profitmetrics.io/kb-ticket/new)

[Contact Support](https://knowledge.profitmetrics.io/kb-ticket/new?hsLang=en)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge base](https://knowledge.profitmetrics.io/?hsLang=en)
2. [Privacy & Consent](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en)
3. [Consent Management Platforms](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#consent-management-platforms)

# How to set up Cookiebot with the Shopify Customer Privacy API

## Shopify's Customer Privacy API is the consent signal that ProfitMetrics and most other Shopify apps use to decide whether tracking is allowed. Cookiebot captures the visitor's consent in its banner, but you need to connect it to the Customer Privacy API so Shopify knows what was chosen. The steps below cover the three ways Cookiebot can be installed on a Shopify store.

#### **What You Need**

| Requirement | Where to find it |
| --- | --- |
| **Cookiebot account** | [cookiebot.com](https://www.cookiebot.com/) — free or paid plan |
| **Shopify store** | Admin access required to install apps or edit theme code |
| **ProfitMetrics Shopify app** | Installed and configured |

---

#### **Choose an installation method**

| Method | When to use it |
| --- | --- |
| **Cookiebot CMP App** *(recommended)* | You want the simplest setup. The app handles the Customer Privacy API automatically — no bridge code required. |
| **GTM (Cookiebot template)** | Cookiebot is loaded via Google Tag Manager and you want to keep tracking inside GTM. |
| **Theme installation** | Cookiebot is loaded directly from your theme code, without GTM or the app. |

---

#### **Option 1: Cookiebot CMP App (recommended)**

The [Cookiebot CMP app](https://apps.shopify.com/cookiebot-cmp-gdpr-compliance) runs through Shopify's App Embed framework, which handles script blocking and writes consent into the Customer Privacy API automatically. No bridge code, snippets, or GTM tags are required — Cookiebot themselves recommend the app over the manual installation for this reason.

1. Open the Cookiebot CMP app in the Shopify App Store and click **Install**.
2. Connect the app to your Cookiebot account by entering your **Domain Group ID** when prompted.
3. Customise the banner and confirm the cookie categories (Necessary, Preferences, Statistics, Marketing).
4. Publish the banner to your storefront.

That's it — skip ahead to [Disable Shopify's native cookie banner](https://knowledge.profitmetrics.io/how-to-set-up-cookiebot-with-the-shopify-customer-privacy-api#disable-banner), then [Verification](https://knowledge.profitmetrics.io/how-to-set-up-cookiebot-with-the-shopify-customer-privacy-api#verification).

---

### **Option 2: GTM (Cookiebot template)**

If you load Cookiebot through Google Tag Manager, use the official **Cookiebot CMP** template from the GTM Community Template Gallery, then add the Customer Privacy API bridge as a snippet in your theme.

#### Step 1: Add the Cookiebot CMP template in GTM

1. In GTM, go to **Templates** → **Tag Templates** → **Search Gallery**.
2. Search for **Cookiebot CMP** and add the official template (publisher: Cookiebot).
3. Go to **Tags** → **New** and select the **Cookiebot CMP** tag type.
4. Enter your **Domain Group ID** (the `data-cbid` value from your Cookiebot dashboard).
5. Set the trigger to **Consent Initialization - All Pages** so Cookiebot loads before any consent-gated tags.
6. Save and publish the container.

#### Step 2: Add the Customer Privacy API bridge in your theme

Follow the snippet steps in [Option 3](https://knowledge.profitmetrics.io/how-to-set-up-cookiebot-with-the-shopify-customer-privacy-api#option-3) to create the `cookie-consent` snippet and render it in `theme.liquid`. Place the {% render 'cookie-consent' %} line **right after** the `{{ content_for_header }}` line.

---

### Option 3: Theme installation

If Cookiebot is loaded directly from your theme (not GTM, not the app), follow the steps documented in [Cookiebot's official Shopify guide](https://support.cookiebot.com/hc/en-us/articles/360006184253-Shopify-installation).

#### Step 1: Open the theme code editor

1. In the Shopify admin, go to the left-hand menu and click **Themes**.
2. Click the **Customize** button on your active theme.
3. Click the **•••** button.
4. Select **Edit code**.

#### Step 2: Create the cookie-consent snippet

1. Under the **Snippets** section, click **Add a new snippet**.
2. Name the new snippet `cookie-consent` and click **Create snippet**.

Open the new `cookie-consent.liquid` file and add the following content:

```
<script>  function feedback() {    const p = window.Shopify.customerPrivacy;    console.log(`Tracking ${p.userCanBeTracked() ? "en" : "dis"}abled`);  }  window.Shopify.loadFeatures(    [      {        name: "consent-tracking-api",        version: "0.1",      },    ],    function (error) {      if (error) throw error;      if ("Cookiebot" in window) window.Shopify.customerPrivacy.setTrackingConsent({        "analytics": false,        "marketing": false,        "preferences": false,        "sale_of_data": false,      }, () => console.log("Awaiting consent"));    }  );  window.addEventListener("CookiebotOnConsentReady", function () {    const C = Cookiebot.consent,      existConsentShopify = setInterval(function () {        if (window.Shopify.customerPrivacy) {          clearInterval(existConsentShopify);          window.Shopify.customerPrivacy.setTrackingConsent({            "analytics": C["statistics"],            "marketing": C["marketing"],            "preferences": C["preferences"],            "sale_of_data": C["marketing"],          }, () => console.log("Consent captured"))        }      }, 100);  });</script>
```

Save the snippet by clicking the **Save** button.

#### Step 3: Render the snippet in theme.liquid

Open `layout/theme.liquid` and add this line after the `{{ content_for_header }}`:

```
{% render 'cookie-consent' %}
```

Click **Save**.

---

#### **Disable Shopify's native cookie banner**

If Shopify's built-in cookie banner is enabled alongside Cookiebot, visitors will see two banners and Shopify will continue to manage consent itself instead of deferring to Cookiebot.

1. In the Shopify admin, go to **Settings** → **Customer privacy** → **Cookie banner**.
2. Confirm that **Cookiebot CMP** appears under **Installed privacy apps** (if you used Option 1).
3. Click **Remove cookie banner** and confirm in the modal.

---

#### **Verification**

Once installed, confirm consent is flowing into the Customer Privacy API:

1. Open your storefront in a private/incognito window.
2. When the Cookiebot banner appears, accept all cookies.
3. Open DevTools and run this in the console:

```
window.Shopify.customerPrivacy.userCanBeTracked()
```

It should return `true` after consent is given. Reload the page, reject the banner, and run the same command — it should now return `false`.

You can also watch the console for the log messages emitted by the bridge: `Awaiting consent` on initial page load, then `Consent captured` after the visitor responds to the banner.

---

#### **Troubleshooting**

| Symptom | What to check |
| --- | --- |
| The Cookiebot banner does not appear on your storefront | Open your storefront and right-click anywhere on the page → **Inspect** → **Console** tab. Cookiebot prints an error message there explaining why the banner did not load. The two most common causes are: - Your storefront domain has not been added to your Cookiebot account. Add it in the Cookiebot dashboard under **Settings** → **Domains**. - Your Cookiebot payment method has expired. Update your card in the Cookiebot dashboard under **Account** → **Billing**. |
| Two cookie banners appear on the storefront | Shopify's native banner is still active. Follow the [Disable Shopify's native cookie banner](https://knowledge.profitmetrics.io/how-to-set-up-cookiebot-with-the-shopify-customer-privacy-api#disable-banner) steps above. |
| The banner appears but Shopify never registers the visitor's choice | The bridge between Cookiebot and the Customer Privacy API is not running. For **Option 1**, open your theme's App embeds and confirm **Cookiebot CMP** is toggled on. For **Options 2 and 3**, confirm `` is present in `theme.liquid` and appears *before* your Cookiebot or GTM script. |

If you have run the diagnostics in the console above and consent still is not flowing through correctly, contact [support@profitmetrics.io](mailto:support@profitmetrics.io) with a screenshot of the console output and we will help you investigate.

- [Getting Started](https://knowledge.profitmetrics.io/getting-started?hsLang=en#main-content)

    - [Learn the Basics](https://knowledge.profitmetrics.io/getting-started?hsLang=en#learn-the-basics)
    - [Prepare for Onboarding](https://knowledge.profitmetrics.io/getting-started?hsLang=en#prepare-for-onboarding)
    - [Account Setup](https://knowledge.profitmetrics.io/getting-started?hsLang=en#account-setup)
- [E-commerce Platforms](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#main-content)

    - [Shopify](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#shopify)
    - [WooCommerce](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#woocommerce)
    - [Magento](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#magento)
    - [PrestaShop](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#prestashop)
    - [BigCommerce](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#bigcommerce)
    - [Shopware](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#shopware)
    - [DanDomain & Related](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#dandomain-related)
    - [Universal Integration (Clientside)](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#universal-integration-clientside)
    - [Universal Integration (Server-side Hybrid)](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#universal-integration-server-side-hybrid)
    - [Other Platforms](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#other-platforms)
    - [Developer Documentation](https://knowledge.profitmetrics.io/e-commerce-platforms?hsLang=en#developer-documentation)
- [Ad Channels](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#main-content)

    - [Google Ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#google-ads)
    - [Meta (Facebook/Instagram)](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#meta-facebook-instagram)
    - [Microsoft Bing Ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#microsoft-bing-ads)
    - [Google Analytics 4](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#google-analytics-4)
    - [Partner-ads](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#partner-ads)
    - [Other Channel Configuration](https://knowledge.profitmetrics.io/ad-channels?hsLang=en#other-channel-configuration)
- [Tracking & Conversion Setup](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#main-content)

    - [Overview](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#overview)
    - [Conversion Booster for Google Ads](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-for-google-ads)
    - [Conversion Booster for Meta](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-for-meta)
    - [Conversion Booster Custom Pixels](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#conversion-booster-custom-pixels)
    - [Enhanced Conversions](https://knowledge.profitmetrics.io/tracking-conversion-setup?hsLang=en#enhanced-conversions)
- [Shopping Booster](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#main-content)

    - [Overview & Setup](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#overview-setup)
    - [Supplemental Feeds](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#supplemental-feeds)
    - [Campaigns & Labels](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#campaigns-labels)
    - [Troubleshooting](https://knowledge.profitmetrics.io/shopping-booster?hsLang=en#troubleshooting)
- [Product Feed & Costs](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#main-content)

    - [Product Feed](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#product-feed)
    - [Shipping & Payment Costs](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#shipping-payment-costs)
    - [Expenses](https://knowledge.profitmetrics.io/product-feed-costs?hsLang=en#expenses)
- [Dashboard, Orders & Reporting](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#main-content)

    - [Dashboard & Orders](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#dashboard-orders)
    - [Looker Studio](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#looker-studio)
    - [Google BigQuery](https://knowledge.profitmetrics.io/dashboard-orders-reporting?hsLang=en#google-bigquery)
- [Account & Billing](https://knowledge.profitmetrics.io/account-billing?hsLang=en#main-content)

    - [Users & Access](https://knowledge.profitmetrics.io/account-billing?hsLang=en#users-access)
    - [Billing & Invoices](https://knowledge.profitmetrics.io/account-billing?hsLang=en#billing-invoices)
- [Privacy & Consent](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#main-content)

    - [GDPR](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#gdpr)
    - [Consent Management Platforms](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#consent-management-platforms)
    - [Google Consent Mode](https://knowledge.profitmetrics.io/privacy-consent?hsLang=en#google-consent-mode)
- [For Agencies](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#main-content)

    - [Getting Started as an Agency](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#getting-started-as-an-agency)
    - [Agency Certification](https://knowledge.profitmetrics.io/for-agencies?hsLang=en#agency-certification)
- [Shopify](https://knowledge.profitmetrics.io/shopify?hsLang=en)
- [PrestaShop](https://knowledge.profitmetrics.io/prestashop?hsLang=en)
- [Google Ads](https://knowledge.profitmetrics.io/google-ads?hsLang=en#main-content)

    - [troubleshoot](https://knowledge.profitmetrics.io/google-ads?hsLang=en#troubleshoot)
- [Meta (Facebook / Instagram)](https://knowledge.profitmetrics.io/meta-facebook-instagram?hsLang=en)
- [Uncategorized](https://knowledge.profitmetrics.io/uncategorized?hsLang=en)
- [Billing](https://knowledge.profitmetrics.io/billing?hsLang=en)
- [Google Sheets](https://knowledge.profitmetrics.io/google-sheets?hsLang=en)
- [Account](https://knowledge.profitmetrics.io/account?hsLang=en)
- [Ideal Shop](https://knowledge.profitmetrics.io/ideal-shop?hsLang=en)

[![ProfitMetrics logo black version](https://knowledge.profitmetrics.io/hs-fs/hubfs/pm_logotype_blue.png?width=193&height=28&name=pm_logotype_blue.png "ProfitMetrics logo black version")](https://profitmetrics.io)

<https://www.facebook.com/ProfitMetrics/> <https://podcasts.apple.com/> [mailto:support@profitmetrics.io](mailto:support@profitmetrics.io)

Copyright © 2026, ProfitMetrics ApS