TOPICS×
Get User IDs and Regions Through the Experience Cloud ID Service
ID service customers should refer to this section for information on how to read the visitor cookie for the IDs required to make DCS API calls.
Get the User ID from the ID Service Cookie
The
Experience Cloud ID service
assigns visitor and region IDs to users who come to your website. These IDs identify users across all the solutions in the Experience Cloud and they are required if you want to make DCS calls.
- The user ID is required to identify and associate data with a particular visitor.
- The region ID is required because it is tied to a regional server name, which you need to send data to the DCS. The DCS stores information in data centers that are geographically closest to site visitors. See DCS Region IDs, Locations, and Host Names .
ID service customers can extract this information from the ID service cookie or by calling a function. The table below describes the tasks or steps you need to complete to get started.
Code in
italics
represents a variable placeholder.
Task | Description |
---|---|
1. Check your
Experience Cloud
status
| You need a
Experience Cloud
account to use the ID service. If you have a
Experience Cloud
account, great!
If you're not part of the
Experience Cloud
, then sign up. We'd love to have you and there's always room for more. For instructions on how to set up an account, see
Core Services - Enabling Your Solutions
.
|
2. Set up the
ID service
| The
ID service
consists of JavaScript code that gets put on each page you want to use for data collection. See the ID service
implementation guides
for more information.
|
3. Read the
ID service
cookie
| The
ID service
stores the user and region ID in the AMCV cookie. The full cookie name is
AMCV_
###
@AdobeOrg
. The
###
elements are placeholders for your organization ID. See
Cookies and the Experience Cloud ID
for details.
Parse the AMCV cookie for these key-value pairs:
You can make calls to the
DCS
once you have the user and region IDs.
|
4. Retrieve the
Experience Cloud ID
with getMarketingCloudVisitorID
| (Optional)
This function returns the
Experience Cloud
visitor ID. It is designed for custom solutions and specific use cases. See
Working With getMarketingCloudVisitorID
below and the
related ID service documentation
.
You don't need to use this if you get the user and location IDs from the ID service cookie.
|
Working With getMarketingCloudVisitorID
Another way to get the visitor ID is with the
getMarketingCloudVisitorID
function. When invoked, this function queries the ID service and returns an ID.
getMarketingCloudVisitorID
accepts the optional
callback
argument as shown:
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
Once you have the user and region ID, you can start sending and receiving DCS data. See
Making DCS API Calls
.