ÃÛ¶¹ÊÓÆµ 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.
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 ÃÛ¶¹ÊÓÆµ 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 ÃÛ¶¹ÊÓÆµ 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);
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.
ÃÛ¶¹ÊÓÆµ 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
key
ÃÛ¶¹ÊÓÆµ Analytics
cookieDomainPeriods
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 centerd2
: Dallas data center
reportSuite
s_code.js
or dtm
).trackingServer
trackingServerSecure
visitorNamespace
ÃÛ¶¹ÊÓÆµ Audience Manager
aamUUIDCookieName
ÃÛ¶¹ÊÓÆµ Experience Cloud Identity Service (ECID)
imsOrgID
ÃÛ¶¹ÊÓÆµ Target
clientCode