ÃÛ¶¹ÊÓƵ

ÃÛ¶¹ÊÓƵ Privacy JavaScript Library overview

As a data processor, ÃÛ¶¹ÊÓƵ processes personal data in accordance with your company’s permission and instructions. As the data controller, you determine the personal data that ÃÛ¶¹ÊÓƵ processes and stores on your behalf. Depending on the information you choose to send through ÃÛ¶¹ÊÓƵ Experience Cloud solutions, ÃÛ¶¹ÊÓƵ 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 for more information on how Experience Cloud solutions collect private data.

The ÃÛ¶¹ÊÓƵ 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 ÃÛ¶¹ÊÓƵ 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 ÃÛ¶¹ÊÓƵ 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 ÃÛ¶¹ÊÓƵ solutions that support them. For example, ÃÛ¶¹ÊÓƵ Audience Manager does not delete the demdex IDs that are stored in third-party cookies, while ÃÛ¶¹ÊÓƵ 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:

  • Install using npm by running the following command: npm install @adobe/adobe-privacy
  • Download from the

You can also install the library through a tag extension. See the overview on the ÃÛ¶¹ÊÓƵ Privacy tag extension for more information.

Instantiate the Privacy JS Library

All apps that utilize the Privacy JS Library must instantiate a new ÃÛ¶¹ÊÓƵPrivacy object, which must be configured to a specific ÃÛ¶¹ÊÓƵ solution. For example, an instantiation for ÃÛ¶¹ÊÓƵ Analytics would look similar to the following:

var adobePrivacy = new ÃÛ¶¹ÊÓƵPrivacy({
    imsOrgID: "{ORG_ID}",
    reportSuite: "{REPORT_SUITE_ID}",
    trackingServer: "{SERVER_URL}",
    clientCode: "{TARGET_CLIENT_CODE}"
});

For a full list of supported parameters for different ÃÛ¶¹ÊÓƵ solutions, see the appendix section on supported ÃÛ¶¹ÊÓƵ solution configuration parameters.

Code samples 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.

ÃÛ¶¹ÊÓƵ solution configuration parameters config-params

The following is a list of the accepted configuration parameters for supported ÃÛ¶¹ÊÓƵ solutions, used when instantiating an ÃÛ¶¹ÊÓƵPrivacy 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 ÃÛ¶¹ÊÓƵ.

ÃÛ¶¹ÊÓƵ 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 ÃÛ¶¹ÊÓƵ 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.

ÃÛ¶¹ÊÓƵ Audience Manager

Parameter
Description
aamUUIDCookieName
Name of the first-party cookie containing the unique user ID returned from ÃÛ¶¹ÊÓƵ Audience Manager.

ÃÛ¶¹ÊÓƵ Experience Cloud Identity Service (ECID)

Parameter
Description
imsOrgID
Your organization ID.

ÃÛ¶¹ÊÓƵ Target

Parameter
Description
clientCode
Client code that identifies a client in ÃÛ¶¹ÊÓƵ Target System.
recommendation-more-help
9cbf7061-a312-49f7-aaf8-a10885d53580