Step 2: Download the Visitor ID Service code
The Visitor ID Service requires the VisitorAPI.js code library. To download this code library:
-
Go to Admin > Code Manager.
-
In Code Manager, click either JavaScrpt (New) or JavaScript (Legacy). This downloads compressed code libraries.
-
Decompress the code file and open the
VisitorAPI.jsfile.
Step 3: Add the Visitor.getInstance function to the Visitor ID Service code
- Previous versions of the Visitor ID Service API placed this function in a different location and required a different syntax. If you are migrating from a version prior to version 1.4, note the new placement and syntax documented here.
- Code in ALL CAPS is a placeholder for actual values. Replace this text with your IMS org ID, tracking server URL, or other named value.
Part 1: Copy the Visitor.getInstance function below
Part 2: Add function code to the VisitorAPI.js file
Place the Visitor.getInstance function at the end of the file after the code block. Your edited file should look like this:
Step 4: Add your IMS org ID to Visitor.getInstance
In the Visitor.getInstance function, replace INSERT-IMS-ORG-ID-HERE with your IMS org ID. If you do not know your IMS org ID, you can find it on the CX Enterprise administration page. Your edited function could look similar to the example below.
var visitor = Visitor.getInstance("1234567ABC@AdobeOrg", { ...
Step 5: Add your tracking servers to Visitor.getInstance
Analytics uses tracking servers for data collection.
Part 1: Find your tracking server URLs
Check your s_code.js or AppMeasurement.js files to find the tracking server URLs. You’ll want the URLs specified by these variables:
s.trackingServers.trackingServerSecure
Part 2: Set tracking server variables
To determine which tracking server variables to use:
- Answer the questions in the decision matrix below. Use the variables that correspond to your answers.
- Replace the tracking server placeholders with your tracking server URLs.
- Remove unused tracking server and CX Enterprise server variables from the code.
- CX Enterprise server URL = tracking server URL
- CX Enterprise server secure URL = tracking server secure URL
If you’re not sure how to find your tracking server see the FAQ and Correctly Populate the trackingServer and trackingServerSecure variables.
Step 6: Update your AppMeasurement.js file
This step requires AppMeasurement. You cannot continue if you’re still using s_code.
Add the Visitor.getInstance function shown below to your AppMeasurement.js file. Place it in the section that contains configurations such as linkInternalFilters, charSet, trackDownloads, etc. :
s.visitor = Visitor.getInstance("INSERT-IMS-ORG-ID-HERE");
(Optional, but recommended) Create a custom prop
Set a custom prop in AppMeasurement.js to measure coverage. Add this custom prop to the doPlugins function of your AppMeasurement.js file:
Step 7: Add visitor API code to the page
Place the VisitorAPI.js file within the <head> tags on each page. When you the VisitorAPI.js file to your page:
- Put it at the beginning of the
<head>section to it appears before other solution tags. - It must execute before AppMeasurement and the code for other CX Enterprise solutions.
Step 8: (Optional) Configure a grace period
If any of these use cases apply to your situation, ask Customer Care to set up a temporary grace period. Grace periods can run for up to 180 days. You can renew a grace period if required.
Partial Implementation
You need a grace period if you have some pages that use the Visitor ID Service and some pages that do not, and they all report into the same Analytics report suite. This is common if you have a global report suite that reports across domains.
Discontinue the grace period after the Visitor ID Service is deployed on all your web pages that report into the same report suite.
s_vi Cookie Requirements
You need a grace period if you require new visitors to have an s_vi cookie after migrating to the Visitor ID Service. This is common if your implementation reads the s_vi cookie and stores it in a variable.
Discontinue the grace period after your implementation can capture the MID instead of reading the s_vi cookie.
See also, Cookies and the Visitor ID Service.
Clickstream Data Integration
You need a grace period if you send data to an internal system from a Clickstream data feed and that processes uses the visid_high and visid_low columns.
Discontinue the grace period after your data ingestion process can use the post_visid_high and post_visid_low columns.
See also, Clickstream Data Column Reference.
Step 9: Test and deploy Visitor ID Service code
You can test and deploy as follows.
Test and verify
To test your Visitor ID Service implementation, check for the:
- AMCV cookie in the domain where you pages is hosted.
- MID value in the Analytics image request with the Adobe debugger.
- See also, Test and Verify the Visitor ID Service.
To verify server-side forwarding, see How to Verify your Server-Side Forwarding Implementation.
Deploy
Deploy your code after it passes testing.
If you enabled a grace period:
- Ensure the Analytics ID (AID) and MID are in the image request.
- Remember to disable the grace period once you meet the criteria for discontinuation.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an event