Use Case 2: Request a Custom Data Set

This code uses an optional array to return a specific set of IDs using the visitor.FIELDS enum. In this case, we only want the visitor’s Experience Cloud ID (MCID) and Analytics ID (MCAID). Your request and response could look similar to the following examples.

//Call the ID service
var visitor = Visitor.getInstance("Insert Experience Cloud organization ID here", { ... });

// Add an optional array to specify which IDs you want to return.
visitor.getVisitorValues(visitorIdsCallback, [visitor.FIELDS.MCMID, visitor.FIELDS.MCAID]);

The customized sample response returns only those IDs specified in the request.

//Formatted IDs in JSON response
{
    MCMID: 'mid-1234',
    MCAID: 'aid-4321'
}

Response Parameters Defined

The following table lists and defines the response parameters. These are also all the values in the visitor.FIELDS enum. Note, this method returns and empty string if there are no values for a particular variable.

ValueDescription
MCAAMBEncrypted Audience Manager metadata known as "the blob."
MCAAMLH

The data collection region ID. This is a numeric identifier for the geographic location of a particular ID service data center.

See DCS Region IDs, Locations, and Host Namesand getLocationHint.

MCAIDThe visitor's Analytics ID.
MCMID

The visitor's Experience Cloud ID.

See Cookies and the Experience Cloud Identity Service.

MCOPTOUT

A flag that indicates if a visitor has opted out of data collection.

Values include:

  • 'isoptedout-true' : A visitor has opted out of data collection.
  • 'isoptedout-false' : A visitor has not opted out of data collection.

Experience Cloud Services


Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more