> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.pandectes.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Use Pandectes Consent Event with Shopify Custom Pixel

### Overview

This article shows how to create a custom pixel on your Shopify store that listens to the Pandectes consent event, so you can run your own code (for example Google Tag Manager) only with the visitor's consent.

### Turn on Pandectes events

1. In Shopify Admin, go to **Apps > Pandectes GDPR > Integrations**.
2. On the **Pandectes events** card, click **Configure**.
3. Turn on the toggle at the top of the page and click **Save**.

![Pandectes events toggle and event structure](https://images.pandect.es/knowledge-base/use-pandectes-consent-event-with-shopify-custom-pixel-1.png =900xauto)

Pandectes now pushes the `Pandectes_Consent_Update` event into the **dataLayer** on every page load and on every interaction with the banner. The **Configuration** box shows the event structure. The event is also available to the **Shopify Web Pixels API** and to **custom pixels** in Customer events.

### Create custom pixel code

1. Go to your store **Settings > Customer Events** section
2. Click on the **Add custom pixel** button and give a name such as *Cookie Consent Pixel* and click **Add pixel**
3. In the **Customer privacy** section select in the **Permission** section the option **Not required** to let the pixel always run
4. In the **Code** area remove the default content and add the Pixel code provided below:

```
analytics.subscribe("Pandectes_Consent_Update", event => {
    //run your custom code here ex. GTM
});
```

5. **Save** the pixel.
6. **Connect** the pixel.

|| If you need any help with the setup, do not hesitate to drop us a line at **support@pandectes.io** or via our **live chat**.