This lesson will guide your through the steps required to implement the Adobe Experience Platform Identity Service extension and send customer ids.
The Adobe Experience Platform Identity Service sets a common visitor id across all Adobe solutions in order to power Experience Cloud capabilities such as audience-sharing between solutions. You can also send your own customer ids to the Service to enable cross-device targeting and integrations with your Customer Relationship Management (CRM) system.
Adobe Experience Platform Launch is being integrated into Adobe Experience Platform as a suite of data collection technologies. Several terminology changes have rolled out in the interface which you should be aware of while using this content:
At the end of this lesson, you will be able to:
You should have already completed the lessons in the Configure tags section.
Since this is the first extension you are adding, here is a quick overview of extensions. Extensions are one of the core features of tags. An extension is an integration built by Adobe, an Adobe partner, or any Adobe customer that adds new and endless options for the tags that you can deploy to your website. If you think of tags as an operating system, extensions are the apps that you install so tags can do the things you need it to do.
To add the Identity Service Extension
In the left navigation, click Extensions
Click Catalog to go to the Extensions Catalog page
Note the variety of extensions that are available in the Catalog
In the filter at the top, type “id” to filter the Catalog
On the card for the Adobe Experience Platform Identity Service, click Install
Note that your Experience Cloud Organization ID has been auto-detected for you.
Leave all of the default settings and click Save to Library and Build
Each version of the Identity Service extension comes with a specific version of VisitorAPI.js which is noted in the extension description. You update the VisitorAPI.js version by updating the Identity Service extension.
The Identity Service extension is one of the few tag extensions that makes a request without having to use a rule action. The extension will automatically make a request to the Identity Service on the first page load of the first visit to a website. Once the ID has been requested, it will be stored in a first party cookie beginning with “AMCV_”.
To validate the Identity Service extension
Open the Luma site
Make sure the Debugger is mapping the tag property to your Development environment, as described in the earlier lesson.
On the Summary tab of the Debugger, the tags section should indicate that the Adobe Experience Platform Identity Service extension is implemented.
Also, on the Summary tab, the Identity Service section should populate with the same Org ID that was on your extension configuration screen in the Data Collection interface:
The initial request to retrieve the Visitor ID might appear in the Identity Service tab of the Debugger. It might have already been requested, though, so don’t worry if you don’t see it:
After the initial request to fetch the Visitor ID, the ID is stored in a cookie whose name begins with AMCV_
. You can confirm that the cookie has been set by doing the following:
Application
tabCookies
on the left sidehttps://luma.enablementadobe.com
That’s it! You’ve added your first extension! For more details on the configuration options of the Identity Service, see the documentation.
Next, you will send a Customer ID to the Identity Service. This will allow you to integrate your CRM with the Experience Cloud as well as track visitors across devices.
In the earlier lesson, Add Data Elements, Rules, and Libraries you created a data element and used it in a rule. Now, you will use those same techniques to send a Customer ID when the visitor is authenticated.
Start by creating two data elements:
Authentication State
—to capture whether or not the visitor is logged inEmail (Hashed)
—to capture the hashed version of the email address (used as the customer ID) from the data layerTo create the data element for Authentication State
Click Data Elements in the left navigation
Click the Add Data Element button
Name the data element Authentication State
For the Data Element Type, select Custom Code
Click the Open Editor button
In the Edit Code window, use the following code to return values of “logged in” or “logged out” based on an attribute in the Luma site’s data layer:
if (digitalData.user[0].profile[0].attributes.loggedIn)
return "logged in"
else
return "logged out"
Click Save to save the custom code
Leave all of the other settings on their default values
Click Save to Library to save the data element and return to the data elements page. We will not need to do a “Build” until we’ve made all of our changes and are ready to validate.
By knowing the authentication state of the user, you know when a customer id should exist on the page to send to the Identity Service. The next step is to create a data element for the customer id itself. On the Luma demo site, you will use the hashed version of the visitor’s email address.
To add the data element for the hashed email
Click the Add Data Element button
Name the data element Email (Hashed)
For the Data Element Type, select JavaScript Variable
As the JavaScript variable name, use the following pointer to a variable in the Luma site’s data layer: digitalData.user.0.profile.0.attributes.username
Leave all of the other settings on their default values
Click Save to Library to save the data element
The Adobe Experience Platform Identity Service passes the Customer IDs in rules using an action called “Set Customer IDs.” You will now create a rule to trigger this action when the visitor is authenticated.
To create a rule to send the Customer IDs
In the left navigation, click Rules
Click Add Rule to open the Rule Builder
Name the rule All Pages - Library Loaded - Authenticated - 10
This naming convention indicates you are firing this rule at the top of all pages when the user is authenticated and it will have an order of “10”. Using a naming convention like this—instead of naming it for the solutions triggered in the actions—will allow you to minimize the overall number of rules needed by your implementation.
Under Events click Add
10
. The Order controls the sequence of rules that are triggered by the same event. Rules with a lower order will fire before rules with a higher order. In this case, you want to set the customer ID before you fire the Target request, which you will do in the next lesson with a rule with an order of 50
.Under Conditions click Add
For the Condition Type select Value Comparison
Click the icon to open the Data Element modal
In the Data Element Modal, click on Authentication State and then click Select
Make sure Equals
is the operator
Type “logged in” in the text field, causing the rule to fire whenever the Data Element “Authentication State” has a value of “logged in”
Click Keep Changes
Under Actions click Add
For the Extension select Experience Cloud ID Service
For the Action Type select Set Customer IDs
For the Integration Code enter crm_id
For the Value enter open the Data Element selector modal and select the Email (Hashed)
For the Auth State select Authenticated
Click the Keep Changes button to save the action and return to the Rule Builder
Click the Save to Library and Build button to save the rule
You’ve now created a rule that will send the Customer ID as a variable crm_id
when the visitor is Authenticated. Since you specified the Order as 10
this rule will fire before your All Pages - Library Loaded
rule created in the Add Data Elements, Rules and Libraries lesson which uses the default Order value of 50
.
To validate your work, you will log into the Luma site to confirm the behavior of the new rule.
To log into the Luma site
Open the Luma site
Make sure the Debugger is mapping the tag property to your Development environment, as described in the earlier lesson
Click the LOGIN link in the top right corner of the Luma site
Enter test@adobe.com
as the username
Enter test
as the password
Click the LOGIN button
Return to the Homepage
Now, confirm the customer id is sent to the Service using the Debugger extension.
To validate that the Identity Service is passing the customer id
Make sure the tab with the Luma site is in focus
In the Debugger, go to the Adobe Experience Platform Identity Service tab
Expand your Org ID
Click on the cell with the Customer ID - crm_id
value
In the modal, note the customer id value and that the AUTHENTICATED
state is reflected:
Note that you can confirm the hashed email value by viewing the source code of the Luma page and looking at the username property. It should match the value you see in the Debugger:
Tags also has rich console logging features. To turn them on, go to the Tools tab in the Debugger and turn on the tags Console Logging toggle.
This will turn on console logging both in your browser console and in the Logs tab of the Debugger. You should see the logging of all of the rules you have created so far! Note that new log entries are added to the top of the list, so your rule “All Pages - Library Loaded - Authenticated - 10” should fire before the “All Pages - Library Loaded” rule and appear below it in the Debugger’s Console Logging: