> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/partner-recipes/cookie-consent-integrations/integrating-onetrust-shopify.md).

# Integrating OneTrust with Shopify

Connect OneTrust to Shopify's Customer Privacy API so Littledata tracking follows each visitor's cookie choices.

[OneTrust](https://onetrust.com) manages visitors' cookie preferences and helps you with [GDPR cookie compliance](https://help.littledata.io/partner-recipes/cookie-consent-integrations/shopify-customer-consent-api). This guide shows you how to connect OneTrust to Shopify so Littledata tracking follows each visitor's choices.

OneTrust's app passes consent choices to Shopify. Littledata then reads those choices and updates tracking in your destinations. For this to work, **Consent mode** must be turned on for each destination.

### Set up OneTrust with Littledata

{% stepper %}
{% step %}
**Install the OneTrust Shopify app**

Install OneTrust's [Shopify app](https://apps.shopify.com/onetrust-consent-management). It syncs consent choices with Shopify's Customer Privacy API.
{% endstep %}

{% step %}
**Map the OneTrust categories**

In the OneTrust app, [map the OneTrust category IDs](https://my.onetrust.com/s/article/UUID-a19a7752-4386-f65f-f109-fd6bde724bcf?language=en_US) to Shopify's consent categories.

<div data-with-frame="true"><figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-ebce6e34dced906a5f722fcd0f13341789ffffb0%2Fonetrust-mapping.png?alt=media" alt="OneTrust Shopify app mapping OneTrust category IDs to Shopify consent categories"><figcaption></figcaption></figure></div>

We recommend this mapping:

| Shopify category | OneTrust category ID |
| ---------------- | -------------------- |
| Analytics        | C0002                |
| Marketing        | C0004                |
| Sale of data     | -                    |
| Preferences      | C0003                |
| {% endstep %}    |                      |

{% step %}
**Install Littledata**

Install Littledata's [Shopify to Google Analytics](https://help.littledata.io/integrations/shopify-to-google-analytics/littledata-shopify-install-guide) or [Shopify to Segment](https://help.littledata.io/integrations/shopify-to-segment/installation) connection.
{% endstep %}

{% step %}
**Turn on Consent mode**

In the Littledata app, open each destination that should respect consent: click the **⋯** menu on its card and choose **Settings**. Open the **General** tab, turn on **Consent mode** and click **Save**.

Consent mode is off by default. If [Shopify Markets](https://help.littledata.io/sources/shopify-markets/markets-settings) is enabled, check the setting for every market. See [data pipeline settings](https://help.littledata.io/advanced/developer/data-pipeline-settings) for more.
{% endstep %}
{% endstepper %}

### How tracking follows OneTrust choices

When a visitor changes their choices in OneTrust, OneTrust updates Shopify's Customer Privacy API. Littledata reads the visitor's current consent for each category (analytics and marketing) from that API and updates tracking right away.

For example, with the mapping above:

* If the visitor accepts performance cookies (`C0002`), Shopify records analytics consent and Littledata can track them in Google Analytics.
* If the visitor later turns off performance cookies, analytics consent is removed and that tracking stops.

What each destination does with the choices:

* **Google:** consent is passed through [Google Consent Mode v2](https://help.littledata.io/integrations/shopify-to-google-analytics/using-google-consent-modev2).
* **Other ad platforms (such as Meta, TikTok and Pinterest):** browser tracking only runs when the visitor accepts marketing cookies.
* **Segment:** Littledata [passes the full consent object](https://help.littledata.io/integrations/shopify-to-segment/segment-consent-management) with every event, for Segment Consent Management and your downstream destinations.

This also works with any other [cookie banner app](https://help.littledata.io/partner-recipes/cookie-consent-integrations/shopify-customer-consent-api) that connects to Shopify's Customer Privacy API.

### Related articles

* [Using cookie consent banners for GDPR compliance](https://help.littledata.io/partner-recipes/cookie-consent-integrations/shopify-customer-consent-api)
* [Integrating Consentmo with Shopify](https://help.littledata.io/partner-recipes/cookie-consent-integrations/integrating-consentmo-shopify)
* [Using Segment Consent Management with Shopify](https://help.littledata.io/integrations/shopify-to-segment/segment-consent-management)
