Implement the Experience Cloud Identity Service for Target implement-the-experience-cloud-id-service-for-target
These instructions are for Target customers who want to use the Experience Cloud Identity Service and do not use Data Collection tags. However, we strongly recommend that you use tags to implement the ID service. Tags streamlines the implementation workflow and automatically ensures the correct code placement and sequencing.
- Read the requirements before you begin.
- Configure and test this code in a development environment before implementing it in production.
Step 1: Get the ID Service code section-b32ba0548aa546a79dd38be59832a53e
The ID Service requires the VisitorAPI.js
code library. Contact Customer Care to get this code.
Step 2: Add the Visitor.getInstance function to the ID Service code section-287ef2958e9f43858fe9d630ae519e22
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
Place the Visitor.getInstance
function 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 section-522b1877be9243c39b222859b821f0ce
In the Visitor.getInstance
function, replace INSERT-MARKETING-CLOUD-ORGANIZATION ID-HERE
with 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");
Step 4: Add Visitor API code to the page section-02d8dd7678b64a85b5abc1c4ef0845dd
Deploy the VisitorAPI.js
file to your site in the <head>
tags before the reference to the mbox.js
file. 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 section-e81ee439bb8a4c2abea43d76f3112e9c
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.
- Verify
mboxMCGVID
appears 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
Deploy your code after it passes testing.