Privacy JavaScript Library

The Privacy JavaScript Library is a set of tools to help create a process for accessing and deleting private data collected by Adobe Commerce.

Commerce data tracking services can store private information applicable to privacy regulations such as the General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA).

This library provides a set of functions for creating privacy data requests and gathering their responses. Use this library to retrieve and remove the data stored in the browser by Adobe Commerce data tracking services.

If Cookie Restriction Mode is enabled, Commerce does not collect behavioral data until the shopper consents. If Cookie Restriction Mode is disabled, Commerce collects behavioral data by default.


The Privacy JavaScript Library is available at the following CDN location:

After you have the file, you will need to add it to a custom module or theme installed in your Adobe Commerce or Magento Open Source instance. Follow the instructions described in the Use custom JavaScript topic to accomplish this task.


Import and instantiate a new MagentoPrivacy object or use the window object to access the Privacy JavaScript functions.

Example using import:

import MagentoPrivacy from "./MagentoPrivacy"

const magePriv = new MagentoPrivacy()

Example using window:

const magePriv = new window.MagentoPrivacy()


The Privacy JS Library provides various functions to manage identity data stored in the browser.