Show Menu

Get User IDs and Regions Through the Experience Cloud ID Service


Working With getMarketingCloudVisitorID

var analyticsID = visitor.getAnalyticsVisitorID(callback)

Callback Usage and Purpose

callback is optional. This function works without it, but returns an ID only when a visitor has a Experience Cloud cookie in their browser. If the visitor cookie is missing, or a visitor doesn't have an ID, the function returns an empty () object. This can happen even after the page loads and the visitor receives a new ID. To avoid this, callback forces this function to check for a visitor ID after the page loads. Without callback , the visitor ID function won't return an ID even if it's written to the visitor's browser later.

Next Steps
