> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/faq/faq-nl/marketingoptimalisatie/hoe-schakel-ik-shopifys-customer-privacy-api-in-voor-cookiebot.md).

# Hoe schakel ik Shopify’s Customer Privacy API in voor Cookiebot?

Geef Cookiebot-toestemmingskeuzes door aan Shopify door een klein fragment aan je thema toe te voegen, zodat de tracking van Shopify zelf de cookievoorkeuren van je bezoekers respecteert.

Door Shopify’s Customer Privacy API in te schakelen, worden de toestemmingskeuzes die bezoekers maken in de Cookiebot-banner doorgegeven aan Shopify, zodat Shopify’s eigen tracking deze respecteert. De onderstaande stappen volgen Cookiebot’s eigen handleiding: [De Customer Privacy API inschakelen](https://support.cookiebot.com/hc/en-us/articles/360006184253-Shopify-installation#:~:text=Enabling%20the%20Customer%20Privacy%20API).

1. Ga in je Shopify-beheerder naar Online Store > Themes, klik op de drie puntjes naast je live thema en kies Edit code. Voeg onder Snippets een nieuw snippet toe.
2. Geef het nieuwe snippet de naam “cookie-consent” en klik op Done.

<figure><img src="https://3977711974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FfZy596pQV5gnXLp9aQF3%2Fimage.png?alt=media&amp;token=61935600-682d-4409-a021-f17ee6671538" alt=""><figcaption></figcaption></figure>

3. Open het lege bestand cookie-consent.liquid en plak de volgende code:

```html
<script>

function feedback() {
  const p = window.Shopify.customerPrivacy;
  console.log(`Tracking ${p.userCanBeTracked() ? "ingeschakeld" : "uitgeschakeld"}`);
}
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("Wachten op toestemming")
    );
  }
);

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("Toestemming vastgelegd"))
        }
      }, 100);
});
</script>
```

4. Sla het snippet op en open vervolgens het bestand theme.liquid in de code van je thema.
5. Voeg direct onder de regel {{ content\_for\_header }} de volgende code toe:

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

6. Sla het bestand theme.liquid op.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adpage.io/faq/faq-nl/marketingoptimalisatie/hoe-schakel-ik-shopifys-customer-privacy-api-in-voor-cookiebot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
