---
title: "How to configure OneTrust with Klaviyo's cookies"
description: "Learn how to configure OneTrust cookie management tools (including their Auto-BlockingTM functionality and Cookie Pro product) tools to work with Klaviyo’s tracking and onsite functionality.Klaviyo.js is Klaviyo's JavaScript snippet that enables Active on Site tracking and signup forms. You have the option to enable this tracking through your ecommerce integration or by pasting the code in your site's theme. Typically when Klaviyo’s JavaScript is enabled, the __kla_id cookie can track and identify site visitors. When not blocked, this cookie temporarily holds personally identifiable information, and once the visitor is identified (e.g., clicking a link through a Klaviyo-sent email), this cookied information is passed to Klaviyo. However, OneTrust requires additional setup steps to ensure this information is captured and then compliantly sent to Klaviyo.In this article we will walk through the steps to ensure OneTrust is capturing visitor information appropriately and sending it to Klaviyo. Please note that you will need to complete all cookie setup steps in this guide and in the order outlined below."
canonical_url: "https://help.klaviyo.com/hc/en-us/articles/4764571493275"
markdown_url: "https://help.klaviyo.com/hc/en-us/articles/4764571493275.md"
locale: "en-us"
category: "Analytics"
section: "About cookies in Klaviyo"
updated: "2026-10-29"
---

# How to configure OneTrust with Klaviyo's cookies

## You will learn

Learn how to configure OneTrust cookie management tools, including Auto-Blocking and CookiePro, to work with Klaviyo’s tracking and onsite functionality.

Klaviyo.js is Klaviyo's JavaScript snippet that enables Active on Site tracking and sign-up forms. You have the option to enable this tracking through your ecommerce integration or by pasting the code in your site's theme. When tracking is allowed, Klaviyo.js uses the first-party __kla_id cookie on your website to recognize visitors. This cookie can temporarily hold personally identifiable information. After Klaviyo identifies a visitor (e.g., when they click a tracking link in a Klaviyo-sent email), it stores an encrypted identifier that connects onsite activity with their profile. OneTrust controls whether Klaviyo’s tracking scripts can load based on your cookie consent settings.

Complete the cookie setup steps below in order to configure consent-based tracking while allowing forms that do not require tracking to work.

## Prerequisites

We suggest visiting our [Guide to Klaviyo Web Tracking ](https://help.klaviyo.com/hc/en-us/articles/115005076767.md)for more information on how our cookies capture known visitor information in different ways.

Additionally, it is important that you have already enabled Klaviyo.js, either directly through your [ecommerce integration](https://help.klaviyo.com/hc/en-us/categories/115000032731.md) or [manually](https://developers.klaviyo.com/en/docs/guide-to-integrating-a-platform-without-a-pre-built-klaviyo-integration#javascript-track-api-for-on-site-metrics).

## Configuring Klaviyo and OneTrust’s tools

Use OneTrust to block Klaviyo’s tracking scripts until visitors give the consent required by your site’s configuration. Blocking all Klaviyo scripts can also stop sign-up forms from working, including forms that do not require tracking.

Klaviyo serves tracking scripts from static-tracking.klaviyo.com and sign-up form scripts from static.klaviyo.com. Configure blocking for the tracking scripts so forms that do not depend on visitor tracking can still load. Klaviyo’s tracking includes:

- if a visitor is active on site, the site referrer URL

- if a visitor views a product or adds a product to their cart (if you’ve enabled this separately)



To configure consent-based tracking in OneTrust’s CookiePro tool while allowing forms that do not require tracking to work, follow the steps below.

## Add your website to CookiePro

If you haven’t already, you will need to add your website to your CookiePro account.

1. Log into your [CookiePro account](http://app.cookiepro.com/) and click the **Cookie Compliance** section under My Apps.

![View of the CookiePro dashboard with Cookie Compliance section highlighted](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/aa7053586e63f854bc6caea92f2827ffb347a1f4-1130x602.jpg?auto=format)

2. Click **Add Website** in the upper right-hand corner.

![The Add Website button in the upper right corner of the CookiePro dashboard page](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/9744068536ed89a1501c6514e991f5df86569973-512x129.jpg?auto=format)

3. From here, you will see a section to set up and add your website and scanning details. Fill in your website URL and name of your organization in the first two fields.

![Scan Website modal with fields to fill website URL and Organization information](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/03e1c1f8f242a13fbcb55389a0ccf4c935ade93a-512x260.png?auto=format)

Note that if you already have an organization associated with your CookiePro account, it will appear in the dropdown as an option.

4. Under the **Advanced Options** section, you can choose to adjust or add your scanning settings.

5. You can adjust the number of website pages that CookiePro will scan by changing the number in the *Limit scan* to field. By default, CookiePro will recommend scanning the first 1,000 pages.

![Inside Scanning Settings page, the ability to input scanned page numbers in field and toggle option on](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/616b7b12194e66fdc19ef77986c18e26ab251d62-512x113.png?auto=format)

6. You can also limit the CookiePro scan to one area of your site. To do this, toggle on the option next to *Limit to this path* *within site.* Make sure that your Website URL above reflects this URL path (e.g., retail.com/signups).

![Inside the Scanning Settings page, the toggle option to only scan pages within one area of your website](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/0a7d29d33c6d7caeb45b09f05ef43daecd70be4f-512x105.png?auto=format)

7. Finally, if there are certain pages or types of pages that you want CookiePro to scan, you can add these in the next few fields. Add page IDs separated by commas to the *Scan Pages with Query* *Parameters* field to scan pages by ID number.

You can also scan pages by URL by adding these URLs in the *Target Pages to Scan* field.

If you have a longer list of URLs or a sitemap, you can copy and paste those into the *Sitemap URLs* field. These URLs will be scanned first in the scan queue.

![In the Scanning Settings page, fields to add additional information on certain pages or areas of your website to scan ](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/edeeeaf0132fb566109b08a7d943f28c1a69d359-512x354.png?auto=format)

8. Once you have all settings completed, click **Scan & Configure** in the lower right corner.

## Configure the static-tracking.klaviyo.com entry

Configure the __kla_id entry that OneTrust associates with static-tracking.klaviyo.com, the source of Klaviyo’s tracking scripts. The __kla_id cookie itself is a first-party cookie stored on your website; these steps configure its entry in OneTrust.

1. Once your website has been added, navigate to **Cookiepedia** > **Categorizations** in the left hand navigation.

2. Look for the Klaviyo static-tracking __kla_id cookie either by searching for it in the field above or by scrolling through the list below. It should be the option labeled as “Persistent” with the *static-tracking.klaviyo.com* hostname.

3. Click the **__kla_id** cookie option.


![Inside the Categorizations page, a highlighted view of the __kla_id cookie in a list](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/aaa7f360c6221a575bb8856e8e2e57e27a16cc8d-1918x312.jpg?auto=format)

4. Once on the *Cookie Details* page, navigate to the **Categorization** tab.

5. If you have not run a scan with Klaviyo and OneTrust yet, make sure to choose **Targeting Cookies** from the *Select a category* dropdown. Make sure that *Third-Party Cookie* is already populated in the *Select a party* dropdown.

![On the Categorization tab, a modal showing dropdowns for selecting a cookie category and cookie party](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/5cccb2439abc1ba174492f083ac0b162b8e59192-512x236.png?auto=format)

6. Once you have made these updates, click **Save** in the lower right corner.

7. In this same area, navigate to the **Source** tab. You should see your website URL appear in the list, as shown in the example below.

![Inside the Sources page, a view of your website URL displayed](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/83a1f4369cc2df7afaf582a7f9f1333c9602f2f2-512x240.png?auto=format)

8. Click on your **website URL**.

9. A dropdown will appear with a new URL; click on the pencil icon to the right.

![A highligted view of the pencil editing icon to the right of your website URL](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/41864d5385820e8c6cf52020f8f0c6cfdf1a581b-858x104.jpg?auto=format)

10. In the modal, remove your current URL and replace it with: *https://static-tracking.klaviyo.com*.

11. Click **Confirm** once you have updated the URL.

![A modal view of your Resource URL with a confirm butotn in the lower right](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/23743fa4692a18292bd1c310955dcac9ff83dcbc-492x278.jpg?auto=format)

12. To confirm that the Klaviyo cookie has been updated, navigate to **Cookiepedia** **> Categorizations** in the left-hand navigation.

13. Click on the **Cookies** tab.

14. From here, your __kla_id cookie should show a “1” listed under both the *Domain Category Overrides* and *Domains* columns.

![On the confirmation screen, a list view showing your __kla_id cookie with domain category overrides and domain as a numeric one](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/2c92dbffd39940ad6fe48eec9c76befbefdf7502-550x156.jpg?auto=format)

## Configure the static.klaviyo.com entry

Configure the __kla_id entry that OneTrust associates with static.klaviyo.com, which serves Klaviyo’s sign-up form scripts. As with the previous entry, this configures OneTrust’s record of the cookie; it does not collect third-party cookies for Klaviyo.

1. Navigate to **Cookiepedia > Categorizations** in the left hand navigation.

2. Look for the static.Klaviyo __kla_id cookie either by searching for it in the field above or by scrolling through the list below. It should be the option labeled as “Persistent” with the *static.klaviyo.com* hostname.

3. Click this **__kla_id** cookie option.


![On the Categorizations page, the __kla_id cookie option highlighted in a list view](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/4cb95c5c38c73a556e7760441c28eab7838ee517-2004x308.jpg?auto=format)

4. Once on the *Cookie Details* page, navigate to the **Categorization** tab.

5. Choose **Targeting Cookies** from the *Select a Category* dropdown. Make sure that *Third-Party Cookie* is already populated in the *Select a party* dropdown.

![On the Categorization tab, a modal showing dropdowns for selecting a cookie category and cookie party](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/5cccb2439abc1ba174492f083ac0b162b8e59192-512x236.png?auto=format)

6. Once you have made these updates, click **Save** in the lower right corner.

7. In this same area, navigate to the **Source** tab. You should see your website URL appear in the list below.

![A modal view of your website URL](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/83a1f4369cc2df7afaf582a7f9f1333c9602f2f2-512x240.png?auto=format)

8. Click on your **website URL**.

9. A dropdown will appear with a new URL; click on the pencil icon that appears to the right of this.

![A highligted view of the pencil editing icon to the right of your website URL](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/41864d5385820e8c6cf52020f8f0c6cfdf1a581b-858x104.jpg?auto=format)

10. In the modal remove your current URL and replace with: *https://static-tracking.klaviyo.com*. 

11. Click **Confirm** once you have updated the URL.

![A modal of your website URL with a confirm button in the lower right](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/23743fa4692a18292bd1c310955dcac9ff83dcbc-492x278.jpg?auto=format)

12. To confirm that the Klaviyo cookie has been updated, navigate to **Cookiepedia > Categorizations** in the left hand navigation.

13. From here, your __kla_id cookie should show a “1” listed under both the *Domain Category Overrides* and *Domains* columns.

![On the confirmation screen, a list view showing your __kla_id cookie with domain category overrides and domain as a numeric one](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/2c92dbffd39940ad6fe48eec9c76befbefdf7502-550x156.jpg?auto=format)

## Configuring your website’s first-party cookie

Configure the first-party __kla_id cookie associated with your website to capture events on your ecommerce site.

1. Navigate to **Cookiepedia > Categorizations** in the left hand navigation.

2. Look for your website specific __kla_id cookie either by searching for it in the field above or by scrolling through the list below. It should be the option labeled as “Persistent” with your website URL as the hostname.

3. Click this **__kla_id** cookie option.

![On the Categorization page, your __kla_id cookie highlighted in a list view](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/153ac93d5dbb7842d7b35974f0c4d9040daeb288-1996x308.jpg?auto=format)

4. Once on the *Cookie Details* page, navigate to the **Categorization** tab.

5. Choose **Targeting Cookies** from the *Select a Category* dropdown. Make sure that *First-Party Cookie* is already populated in the *Select a party* dropdown.

![On the Categorization tab, a modal showing dropdowns for selecting a cookie category and cookie party](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/fb96dec4666c79e6424287f287ae3097b432d693-448x194.jpg?auto=format)

6. Once you have made these updates, click **Save** in the lower right corner.

7. In this same area, navigate to the **Source** tab. You should see your website URL appear in the list below.

![A modal view of your website URL](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/83a1f4369cc2df7afaf582a7f9f1333c9602f2f2-512x240.png?auto=format)

8. Click on your **website URL**.

9. A dropdown will appear with a new URL; click on the pencil icon that appears to the right of this.

![A highligted view of the pencil editing icon to the right of your website URL](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/41864d5385820e8c6cf52020f8f0c6cfdf1a581b-858x104.jpg?auto=format)

10. In the modal remove your current URL and replace with: *https://static-tracking.klaviyo.com*. 

11. Click **Confirm** once you have updated the URL.

![A modal showing your website URL with a Confirm button in the lower right corner](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/23743fa4692a18292bd1c310955dcac9ff83dcbc-492x278.jpg?auto=format)

## Previewing your updated cookies

1. Navigate to **Scripts** in the left-hand navigation.

2. On the Scripts page, click on your **website URL** that appears below.

![On the Scripts page, your website URL will appear in the list below to click](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/10a497b0969212c16d67e9287ff5c34be454c0a9-512x78.png?auto=format)

3. Then, click **Publish Production** in the upper right-hand corner.

![View of the Publish Production button to click in the upper right corner of the Scripts page](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/82bb597f778423086efc2feebb805154059fa7e9-512x160.png?auto=format)

4. In the right sidebar that appears, click **Confirm**.

5. Once on the *Review* tab, scroll down and click **Continue**.

6. Finally, on the *Confirm* *and Publish* tab, click **Publish Test & Preview**. Your preview may take a few seconds to load, but you will see a green check appear below once it’s ready.

🎬 [Watch video on Wistia](https://klaviyo.wistia.com/medias/2b9o3tsibi)


7. Once this success message appears, click **Confirm** below.

## Publishing your updated cookies

**📝 Note:** Before you publish your cookies, it’s important to note that production scripts can take up to 4 hours to take effect on your website. Once you follow the directions below, please wait up to 4 hours to see these updates.

1. Navigate to **Websites** in the left-hand navigation.

2. On the *Websites* page, click on your **website URL** from the list below.

![On the Websites page, your website URL will appear in the list below to click](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/249e7966cc79ada99ff94d6d8a3fc8285767537b-920x196.jpg?auto=format)

3. From here, click **Publish** in the upper right corner.

4. A sidebar modal will appear confirming your version to publish. Click **Confirm** in the lower right corner.

![A modal that will appear from the right sidebar to publish your website cookies with confirm button in lower right corner](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/9091f4cd9dc10079b50fc0832b626b391d1686d1-1066x1234.jpg?auto=format)

5. In this same modal, you will move onto the *Review and Publish* screen. Click the toggle on **Enable Automatic Blocking of Cookies**.

You can read more about CookiePro’s Auto-Blocking feature in their [guide](https://community.cookiepro.com/s/article/UUID-5b03e81d-8b3b-5da8-eed5-b3b015730f3c?language=en_US).

![On the Review and Publish screen, a highlighted area to toggle on Automatic Blocking of Cookies](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/531ec69eb65091676029c80fa54b3cb7a11a283a-1068x1236.jpg?auto=format)

6. Click **Publish** in the lower right corner.

7. A popup will appear with your Production Scripts. Click **Copy Scripts**.

![A popup window showing your production scripts to copy and paste to your website](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/0a3e5e474284309d066c543ef97f85e0cfe8854e-602x806.jpg?auto=format)

8. Place these scripts within the HTML of your ecommerce website. Read more about placing these scripts into your ecommerce website in CookiePro’s step-by-step [guide](https://community.cookiepro.com/s/article/UUID-7478d3b4-18eb-3ac0-a6fd-fb7ebff9f8dc?language=en_US).

## Verify your setup

After publishing, test your website in each cookie consent state:

1. In a fresh browser session, leave **Targeting Cookies** unaccepted. Check that Klaviyo’s tracking scripts are blocked and that forms which do not require tracking can still display.

2. Accept **Targeting Cookies**, then follow the [onsite tracking test](https://help.klaviyo.com/hc/en-us/articles/115005076767.md) to confirm that Klaviyo records activity for an identified test visitor.

3. Withdraw cookie consent and confirm that further onsite activity is no longer tracked.

## Additional Resources

- [Understanding cookies in Klaviyo](https://help.klaviyo.com/hc/en-us/articles/360034666712.md)
  Learn more about how Klaviyo uses cookies as a part of our web tracking to gather information and help improve conversion rates and email performance. This article explains the specific cookie we use and its purposes so that you understand how customers are tracked. This information helps you understand how Klaviyo gathers data, and how this may impact customer privacy and compliance laws.
- [Getting started with Klaviyo onsite tracking](https://help.klaviyo.com/hc/en-us/articles/115005076767.md)
  Learn about the different ways that Klaviyo can support onsite tracking on your ecommerce site. There are 2 key types of onsite tracking:
