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.

NOTE
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.

Installation

The Privacy JavaScript Library is available at the following CDN location: commerce.adobe.net/magentoprivacy.js

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

Initialization

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()

Usage

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

recommendation-more-help
6ad2ec8d-4e70-43dd-8640-a894018d6404