Add the Adobe Experience Platform Identity Service
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.
- Platform Launch (Client Side) is now tags
- Platform Launch Server Side is now event forwarding
- Edge configurations are now datastreams
Learning Objectives
At the end of this lesson, you will be able to:
- Add the Identity Service extension
- Create a data element to collect your customer ids
- Create a rule that uses the “Set Customer IDs” action to send the customer ids to Adobe
- Use the rule ordering feature to sequence rules that fire on the same event
Prerequisites
You should have already completed the lessons in the Configure tags section.
Add the Identity Service Extension
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
Validate the 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:- Open your browser’s Developer Tools
- Go to the
Application
tab - Expand
Cookies
on the left side - Click on the domain
https://luma.enablementadobe.com
- Look for the AMCV_ cookie on the right hand side. You might see several since have loaded the Luma site using both it’s hardcoded tag property as well as mapped to your own.
That’s it! You’ve added your first extension! For more details on the configuration options of the Identity Service, see the documentation.
Send Customer IDs
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.
Create Data Elements for Customer IDs
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 layer
To 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:
code language-javascript 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
Add a Rule to Send the Customer IDs
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
note tip TIP 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
- For the Event Type select Library Loaded (Page Top)
- Expand the Advanced Options section and for the Order enter
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 of50
. - Click the Keep Changes button to return to the Rule Builder
-
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
.
Validate the Customer IDs
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:
Additional Validation Tips
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: