Direct integration Approaches with the Experience Cloud Identity Service

 1.      Purpose

Below approach will help the customers use the ID service on applications that does not support

1.            No Support for Adobe Launch or SDK or VisitorApi.js

2.            No Support for Adobe Launch or SDK but support for visiotrapi.js

 

2.      Methodologies

ECID can be extracted using below methodologies

2.1 Direct trigger of API to fetch ECID(No Support for Adobe Launch or SDK or VisitorApi.js)



We can fetch the ECID by directly triggering an http get to below DCS url of adobe

along with corresponding Org ID.

 

Example:

var org_id="-----------AdobeOrg";

 

"https://dpm.demdex.net/id?d_visid_ver=5.2.0&d_fieldgroup=MC&d_rtbd=json&d_ver=2&d_verify=1&d_nsid=0&d_orgid="+org_id;

https://dpm.demdex.net/id?d_visid_ver=[VER]&d_fieldgroup=MC&d_rtbd=json&d_ver=2&d_verify=1&d_nsid=0&d_orgid=[ORGID]&ts=[TS]

 

·   [VER] is the version of the JavaScript library you are trying to use. When I was testing this visiotrapi.js was of version 5.2.0. Version keeps updating.

·   [ORGID] is the Organization ID. string that ends in @AdobeOrg.

·   [TS] is the timestamp of when you are triggering the api call. This is optional.

This API will initially check for an existing cookie setup for demdex third-party. If it’s not setup in first call response it will setup a demdex cookie and return ECID for first time.


 Subsequent call to this API will just check existing demdex cookie setup and make use of that along with org id and fetch the same ecid from DCS service.


Sample Code:

 <script>

console.log(" Start of ECID Script - Demdex DCS call ");

var org_id="xyz";

var url="https://dpm.demdex.net/id?d_visid_ver=5.2.0&d_fieldgroup=MC&d_rtbd=json&d_ver=2&d_verify=1&d_nsid=0&d_orgid="+org_id;

var requestOptions = {

method: 'GET',

redirect: 'follow',

credentials: 'include'

};

fetch(url, requestOptions)

.then(response => response.json())

.then(result => {

console.log(result);

console.log("Demdex call DCS ECID: ",result.d_mid);

})

.catch(error => console.log('error', error));

</script>

 

2.2 Fetching ECID via Visitorapi.js direct or via launch - ECID extension (No Support for Adobe Launch or SDK but support for visiotrapi.js)


 In this approach we will use the below oob visitorapi.js methods

 2.2.1  Visitor.getInstance("---------@AdobeOrg");

This method is to set  or notify the instance with Org ID of that respective Organization. For Example in case Org ID is 12345@AdobeOrg

 2.2.2 Next Step visitor.getMarketingCloudVisitorID(useMarketingCloudID);

This step will retrieve us with the required ECID

Note: Above method can be used directly by integrating with ECID service by calling visitorapi.js instead of integrating with launch.js.

Sample:

 <script>

console.log(" Start of Visitor ID ")

var useMarketingCloudID = function(id){

console.log("Method 1 ECID Callback: ", id)

};

//get the Experience Cloud ID and pass it to the function

visitor.getMarketingCloudVisitorID(useMarketingCloudID);

var visitorValues = function(values){

console.log("Method 1 ECID Value :", values.MCMID)

};

</script>


Comments

Popular posts from this blog

Adobe AEM Maven Archetype 24 Error - java.nio.file.FileSystemException

Adobe AEM — How to Trigger Custom Workflow from Manage Publication(Manage Publish Wizard)