Implement the Experience Cloud Identity Service for Target
These instructions are for Target customers who want to use the Experience Cloud Identity Service and do not use Dynamic Tag Management (DTM). However, we strongly recommend that you use DTM to implement the ID service. DTM streamlines the implementation workflow and automatically ensures the correct code placement and sequencing.
Step 1: Get the ID Service code
Step 2: Add the Visitor.getInstance function to the ID Service code
Part 1: Copy the Visitor.getInstance function below
var visitor = Visitor.getInstance("INSERT-MARKETING-CLOUD-ORGANIZATION ID-HERE");
Part 2: Add function code to the VisitorAPI.js file
Visitor.getInstancefunction at the end of the file after the code block. Your edited file should look like this:
/* ========== DO NOT ALTER ANYTHING BELOW THIS LINE ========== Version and copyright section */ // Visitor API code library section // Put Visitor.getInstance at the end of the file, after the code library var visitor = Visitor.getInstance("INSERT-MARKETING-CLOUD-ORGANIZATION ID-HERE");
Step 3: Add your Experience Cloud Organization ID to Visitor.getInstance
INSERT-MARKETING-CLOUD-ORGANIZATION ID-HEREwith your Experience Cloud organization ID. If you do not know your organization ID, you can find it on the Experience Cloud administration page. See also, Administration - Core Services . Your edited function could look similar to the example below.
var visitor = Visitor.getInstance("1234567ABC@AdobeOrg");
Do notchange the case of the characters in your organization ID. The ID is case-sensitive and must be used exactly as provided.
Step 4: Add Visitor API code to the page
VisitorAPI.jsfile to your site in the
<head>tags before the reference to the
mbox.jsfile. The Experience Cloud ID service must execute before the first Target network call is generated. Move this code into production after testing and verification.
Step 5: Test and deploy ID Service code
You can test and deploy as follows.
Test and verify
To test your ID service implementation:
- Check for the AMCV cookie in the domain where your page is hosted.
- VerifymboxMCGVIDappears in your Target request and that it contains the Experience Cloud ID (MID).
See Cookies and the Experience Cloud Identity Service for information about the AMCV cookie and the MID.
Deploy your code after it passes testing.