Adobe Privacy JavaScript Library overview

As a data processor, Adobe processes personal data in accordance with your company’s permission and instructions. As the data controller, you determine the personal data that Adobe processes and stores on your behalf. Depending on the information you choose to send through Adobe Experience Cloud solutions, Adobe can store private information applicable to privacy regulations such as the General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA). See the document on privacy in Adobe Experience Cloud for more information on how Experience Cloud solutions collect private data.

The Adobe Privacy JavaScript Library allows data controllers to automate the retrieval of all data subject identities generated by Experience Cloud solutions for a specific domain. Using the API provided by Adobe Experience Platform Privacy Service, these identities can then be used to create access and delete requests for private data belonging to those data subjects.

NOTE

The Privacy JS Library typically only needs to be installed on privacy-related pages, and is not required to be installed on all pages of a website or domain.

Functions

The Privacy JS Library provides several functions for managing identities in Privacy Service. These functions can only be used to manage the identities that are stored in the browser for a specific visitor. They cannot be used to submit information to the Experience Cloud Central Service directly.

The following table outlines the different functions provided by the library:

Function Description
retrieveIdentities Returns an array of matching identities (validIds) that were retrieved from Privacy Service, as well as an array of identities that were not found (failedIds).
removeIdentities Removes each matching (valid) identity from the browser. Returns an array of matching identities (validIds), with each identity containing a isDeletedClientSide boolean which indicates whether this ID has been deleted.
retrieveThenRemoveIdentities Retrieves an array of matching identities (validIds), and then removes those identities from the browser. While this function is similar to removeIdentities, it is best used when the Adobe solution you are using requires an access request before deletion is possible (such as when a unique identifier must be retrieved before providing it in a delete request).
NOTE

removeIdentities and retrieveThenRemoveIdentities only remove identities from the browser for specific Adobe solutions that support them. For example, Adobe Audience Manager does not delete the demdex IDs that are stored in third-party cookies, while Adobe Target deletes all cookies storing their IDs.

Since all three functions represent asynchronous processes, any retrieved identities must be handled using callbacks or promises.

Installation

To start using the Privacy JS Library, you must install it onto your machine using one of the following methods:

You can also install the library through a tag extension in the Data Collection UI. See the overview on the Adobe Privacy tag extension for more information.

Instantiate the Privacy JS Library

All apps that utilize the Privacy JS Library must instantiate a new AdobePrivacy object, which must be configured to a specific Adobe solution. For example, an instantiation for Adobe Analytics would look similar to the following:

var adobePrivacy = new AdobePrivacy({
    imsOrgID: "{IMS_ORG}",
    reportSuite: "{REPORT_SUITE_ID}",
    trackingServer: "{SERVER_URL}",
    clientCode: "{TARGET_CLIENT_CODE}"
});

For a full list of supported parameters for different Adobe solutions, see the appendix section on supported Adobe solution configuration parameters.

Code samples

The following code samples demonstrate how to use the Privacy JS Library for several common scenarios, provided that you are not using tags.

Retrieve identities

This example demonstrates how to retrieve a list of identities from Experience Cloud.

JavaScript

The following code defines a function, handleRetrievedIDs, to be used as a callback or promise to handle the identities retrieved by retrieveIdentities.

function handleRetrievedIDs(ids) {
    const validIDs = ids.validIDs;
    const failedIDs = ids.failedIDs;
}

// If using callbacks:
adobePrivacy.retrieveIdentities(handleRetrievedIDs);

// If using promises:
adobePrivacy.retrieveIdentities().then(handleRetrievedIDs);
Variable Description
validIds A JSON object containing all the IDs that were retrieved successfully.
failedIDs A JSON object containing all the IDs that were not retrieved from Privacy Service, or otherwise could not be found.

Result

If the code executes successfully, validIDs is populated with a list of retrieved identities.

{
    "company": "adobe",
    "namespace": "ECID",
    "namespaceId": 4,
    "type": "standard",
    "name": "Experience Cloud ID",
    "description": "This is the ID generated by the ID Service.",
    "value": "79352169365966186342525781172209986543"
},
{
    "company": "adobe",
    "namespace": "gsurfer_id",
    "namespaceId": 411,
    "type": "standard",
    "value": "WqmIJQAAB669Ciao"
}

Remove identities

This example demonstrates how to remove a list of identities from the browser.

JavaScript

The following code defines a function, handleRemovedIDs, to be used as a callback or promise to handle the identities retrieved by removeIdentities after they have been removed from the browser.

function handleRemovedIDs(ids) {
    const validIDs = ids.validIDs;
    const failedIDs = ids.failedIDs;
}

// If using callbacks:
adobePrivacy.removeIdentities(handleRemovedIDs);

// If using promises:
adobePrivacy.removeIdentities().then(handleRemovedIDs)…
Variable Description
validIds A JSON object containing all the IDs that were retrieved successfully.
failedIDs A JSON object containing all the IDs that were not retrieved from Privacy Service, or otherwise could not be found.

Result

If the code executes successfully, validIDs is populated with a list of retrieved identities.

{
    "company": "adobe",
    "namespace": "ECID",
    "namespaceId": 4,
    "type": "standard",
    "name": "Experience Cloud ID",
    "description": "This is the ID generated by the ID Service.",
    "value": "79352169365966186342525781172209986543",
    "isDeletedClientSide": false
},
{
    "company": "adobe",
    "namespace": "AMO",
    "namespaceId": 411,
    "type": "standard",
    "value": "WqmIJQAAB669Ciao",
    "isDeletedClientSide": true
}

Next steps

By reading this document, you have been introduced to the core functionalities of the Privacy JS Library. After using the library to retrieve a list of identities, you can use those identities to create data access and delete requests to the Privacy Service API. See the Privacy Service API guide for more information.

Appendix

This section contains supplemental information for using the Privacy JS Library.

Adobe solution configuration parameters

The following is a list of the accepted configuration parameters for supported Adobe solutions, used when instantiating an AdobePrivacy object.

All solutions

Parameter Description
key A unique ID that identifies the user or data subject. This property is intended to be used for your own internal tracking purposes and is not used by Adobe.

Adobe Analytics

Parameter Description
cookieDomainPeriods The number of periods in a domain used for cookie tracking (defaults to 2, e.g. .domain.com). Do not define it here unless specified in your JavaScript web beacon.
dataCenter The Adobe data collection data center. This should only be included if it is specified in your JavaScript web beacon. Potential values are:
  • d1: San Jose data center
  • d2: Dallas data center
reportSuite The Report Suite ID as specified in your JavaScript web beacon (for example, s_code.js or dtm).
trackingServer A non-SSL data collection domain. This should only be included if it is specified in your JavaScript web beacon.
trackingServerSecure An SSL data collection domain. This should only be included if it is specified in your JavaScript web beacon.
visitorNamespace The namespace used to group visitors. This should only be included if it is specified in your JavaScript web beacon.

Adobe Audience Manager

Parameter Description
aamUUIDCookieName Name of the first-party cookie containing the unique user ID returned from Adobe Audience Manager.

Adobe Experience Cloud Identity Service (ECID)

Parameter Description
imsOrgID Your IMS Organization ID.

Adobe Target

Parameter Description
clientCode Client code that identifies a client in Adobe Target System.

On this page