51ºÚÁϲ»´òìÈ Privacy JavaScript Library overview
As a data processor, 51ºÚÁϲ»´òìÈ processes personal data in accordance with your company’s permission and instructions. As the data controller, you determine the personal data that 51ºÚÁϲ»´òìÈ processes and stores on your behalf. Depending on the information you choose to send through 51ºÚÁϲ»´òìÈ Experience Cloud solutions, 51ºÚÁϲ»´òìÈ 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 51ºÚÁϲ»´òìÈ 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 51ºÚÁϲ»´òìÈ Experience Platform Privacy Service, these identities can then be used to create access and delete requests for private data belonging to those data subjects.
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:
retrieveIdentities
validIds
) that were retrieved from Privacy Service, as well as an array of identities that were not found (failedIds
).removeIdentities
validIds
), with each identity containing a isDeletedClientSide
boolean which indicates whether this ID has been deleted.retrieveThenRemoveIdentities
validIds
), and then removes those identities from the browser. While this function is similar to removeIdentities
, it is best used when the 51ºÚÁϲ»´òìÈ 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).removeIdentities
and retrieveThenRemoveIdentities
only remove identities from the browser for specific 51ºÚÁϲ»´òìÈ solutions that support them. For example, 51ºÚÁϲ»´òìÈ Audience Manager does not delete the demdex IDs that are stored in third-party cookies, while 51ºÚÁϲ»´òìÈ 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 51ºÚÁϲ»´òìÈ Privacy tag extension for more information.
Instantiate the Privacy JS Library
All apps that utilize the Privacy JS Library must instantiate a new 51ºÚÁϲ»´òìÈPrivacy
object, which must be configured to a specific 51ºÚÁϲ»´òìÈ solution. For example, an instantiation for 51ºÚÁϲ»´òìÈ Analytics would look similar to the following:
var adobePrivacy = new 51ºÚÁϲ»´òìÈPrivacy({
imsOrgID: "{ORG_ID}",
reportSuite: "{REPORT_SUITE_ID}",
trackingServer: "{SERVER_URL}",
clientCode: "{TARGET_CLIENT_CODE}"
});
For a full list of supported parameters for different 51ºÚÁϲ»´òìÈ solutions, see the appendix section on supported 51ºÚÁϲ»´òìÈ 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);
validIds
failedIDs
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)…
validIds
failedIDs
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.
51ºÚÁϲ»´òìÈ solution configuration parameters config-params
The following is a list of the accepted configuration parameters for supported 51ºÚÁϲ»´òìÈ solutions, used when instantiating an 51ºÚÁϲ»´òìÈPrivacy object.
All solutions
key
51ºÚÁϲ»´òìÈ Analytics
cookieDomainPeriods
2
, e.g. .domain.com
). Do not define it here unless specified in your JavaScript web beacon.dataCenter
The 51ºÚÁϲ»´òìÈ 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 centerd2
: Dallas data center
reportSuite
s_code.js
or dtm
).trackingServer
trackingServerSecure
visitorNamespace
51ºÚÁϲ»´òìÈ Audience Manager
aamUUIDCookieName
51ºÚÁϲ»´òìÈ Experience Cloud Identity Service (ECID)
imsOrgID
51ºÚÁϲ»´òìÈ Target
clientCode