Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

DTM : Get Marketing Cloud Visitor ID services value

Alexis Cazes edited this page Oct 27, 2016 · 2 revisions

There is 3 methods to retrieve the mid value set by the Adobe Marketing Cloud Services in DTM : https://dtm.adobe.com/companies/alexis-cc-edi/web_properties/visitor-id-services-and-get-value-from-amcv/data_elements

Solution 1: retrieve the value from the AMCV cookie using the cookie data element

  • Create a data element based on a cookie :

Create Data element

  • Create a second data element based on a custom script that will get the value from the data element above and use regex to extract the value for MCMID:

  • Data Element code:
var mcID = _satellite.getVar("AMCV Data element Cookie");
mcID =(mcID.match(/MCMID%7C(\d+)/)[1]);
return mcID;

Solution 2 : use the Adobe Analytics cookieRead methods to extract the value from the AMCV cookie and use regex to get value for MCMID

  • Code:
var mcID = _satellite.getToolsByType('sc')[0].getS().Util.cookieRead("AMCV_69AA402551915FB10A490D4D@AdobeOrg");
mcID =(mcID.match(/MCMID\|(\d+)/)[1]);
return mcID;

Solution 3 : Use the Visitor ID object in DTM and use method getMarketingCloudVisitorID()

  • Code:
var mcID = _satellite.getVisitorId().getMarketingCloudVisitorID();
return mcID;

Outcome

This is what you will obtain is you call the data element in a console:

Clone this wiki locally