apiadobe-analyticsvisitors

Can we extract all Visitor ID's from Adobe Analytics using API


I'm looking to determine whether it's possible via visitor API to be able to find out all visitor ID's.


Solution

  • In the code examples below, [your mcorgid here] is your company's marketing cloud organization id. If you do not know this then you need to contact Adobe Client Care to get it.

    getMarketingCloudVisitorID - Get the Marketing Cloud Visitor ID (mid= param)

    var visitor = Visitor.getInstance("[your mcorgid here]@AdobeOrg")
    var mcvid = visitor.getMarketingCloudVisitorID(); 
    

    getAnalytcisVisitorID - get legacy visitor id (aid= if applicable)

    var visitor = Visitor.getInstance("[your mcorgid here]@AdobeOrg")
    var aid = visitor.getAnalyticsVisitorID(); 
    

    getCustomerIDs - get all customer IDs

    var visitor = Visitor.getInstance("[your mcorgid here]@AdobeOrg");
    var customerIDs = visitor.getCustomerIDs();
    

    s_fid - Fallback ID

    There is no built-in method for retrieving this, but you can use AA's s.c_r() cookie reading utility function, or any other cookie reading method you have to look for the s_fid cookie. (sidenote: I do not recommend using DTM's _satellite.readCookie()method. It only looks for cookies on the current page's full (not root) domain, and there is no way to change that. Since AA and most other things usually set on root domain, it makes _satellite.readCookie() unreliable in practice).

    var fid = s.c_r('s_fid');