Create data elements
Learn how to create the essential data elements needed to capture data with Experience Platform Web SDK. Capture both content and identity data on the Luma demo site. Learn how to use the XDM schema you created earlier for collecting data using Platform Web SDK through a new data element type called XDM Object.
digitalData
data layer on the Luma site. To view the data layer, open your developer console and type in digitalData
to see the full data layer available.
Regardless of Platform Web SDK, you must continue to create data elements inside your tag property that map to data collection variables from your website, such as a data layer, HTML attribute, or others. Once you create those data elements, you must map them to the XDM schema you created during the configure schemas lesson. To do this, Platform Web SDK extension makes available a new data element type called XDM object. Therefore, creating data elements consists of two actions:
- Mapping website variables to data elements, and
- Mapping those data elements to an XDM object
For step 1, you continue to map your data layer to data elements the way you currently do, using any of the Core tag extension’s data element types. For step 2, Platform Web SDK extension creates a set of new data element types not previously available:
- Event merge ID
- Identity map
- XDM object
This lesson focuses on XDM object and identity map data element types. You will create XDM objects to capture Luma visitors’ activity and authentication status.
Learning objectives
At the end of this lesson, you are able to:
- Create data elements to capture content and user login ID data
- Create an identity map data element
- Map data elements to an XDM object data element
Prerequisites
You have an understanding of what a data layer is, gotten familiar with the Luma demo site data layer, and know how to reference data elements in tags. You must have completed the following previous steps in the tutorial
Create data elements to capture the data layer
Before you begin creating the XDM object, create the following set of data elements mapping to the Luma demo site data layer:
-
Go to Data Elements and select Add Data Element (or Create New Data Element if there are no existing data elements in the tag property)
-
Name the data element
page.pageInfo.pageName
-
Use the JavaScript Variable Data Element type to point to a value in Luma’s data layer:
digitalData.page.pageInfo.pageName
-
Check the boxes for Force lowercase value and Clean text to standardize the case and remove extraneous spaces
-
Leave
None
as the Storage Duration setting since this value is different on every page -
Select Save
Follow the same steps to create these four additional data elements:
-
page.pageInfo.server
mapped todigitalData.page.pageInfo.server
-
page.pageInfo.hierarchie1
mapped todigitalData.page.pageInfo.hierarchie1
-
user.profile.attributes.username
mapped todigitalData.user.0.profile.0.attributes.username
-
user.profile.attributes.loggedIn
mapped todigitalData.user.0.profile.0.attributes.loggedIn
-
cart.orderId
mapped todigitalData.cart.orderId
(you will use this during the Setup Analytics lesson)
digitalData.user[0].profile[0].attributes.username
will not work.Create Identity Map Data Element
Next you can create the Identity Map data element:
-
Go to Data Elements and select Add Data Element
-
Name the Data Element
identityMap.loginID
-
As the Extension, select
Adobe Experience Platform Web SDK
-
As the Data Element Type, select
Identity map
-
This prompts a screen area to the right within the Data Collection interface for you to configure the identity:
-
As the Namespace, select the
Luma CRM Id
namespace that you previously created in the Configure Identities lesson.note note NOTE If you don’t see your Luma CRM Id
namespace, verify that you also created it in your default production sandbox. Only namespaces created in the default production sandbox currently display in the namespace dropdown. -
After the Namespace is selected, an ID must be set. Select the
user.profile.attributes.username
data element created earlier in this lesson, which captures an ID when users are logged into the Luma site. -
As the Authenticated state, select Authenticated
-
Select Primary
-
Select Save
Luma CRM Id
, as the primary identity.Luma CRM Id
), then the person identifier will become the primary identity. Otherwise, ECID
becomes the primary identity.Map data elements to XDM objects
All the data elements you create must be mapped to an XDM object. This object should conform to the XDM schema you created during the Configure a schema lesson.
There are different ways to map data elements to XDM object fields. You can map individual data elements to individual XDM fields or map data elements to entire XDM objects as long as your data element matches the exact key-value pair schema present in the XDM object. In this lesson, you will capture content data by mapping to individual fields. You will learn how to map a data element to an entire XDM object in the Setup Analytics lesson.
Create an XDM object to capture content data:
-
In the left navigation, select Data Elements
-
Select Add Data Element
-
Name the data element
xdm.content
-
As the Extension select
Adobe Experience Platform Web SDK
-
As the Data Element Type select
XDM object
-
Select the Platform Sandbox in which you created the XDM schema in during the Configure an XDM Schema lesson, in this example
DEVELOPMENT Mobile and Web SDK Courses
-
As the Schema, select your
Luma Web Event Data
schema:note note NOTE The sandbox corresponds to the Experience Platform sandbox in which you created the schema. There can be multiple sandboxes available in your Experience Platform instance, so make sure to select the right one. Always work in development first, then production. -
Scroll down until you reach the
web
object -
Select to open it
-
Map the following web XDM variables to data elements
web.webPageDetials.name
to%page.pageInfo.pageName%
web.webPageDetials.server
to%page.pageInfo.server%
web.webPageDetials.siteSection
to%page.pageInfo.hierarchie1%
-
Next, find the
identityMap
object in the schema and select it -
Map to the
identityMap.loginID
data element -
Select Save
At the end of these steps, you should have the following data elements created:
cart.orderId
identityMap.loginID
page.pageInfo.hierarchie1
xdm.content
page.pageInfo.pageName
page.pageInfo.server
user.profile.attributes.loggedIn
user.profile.attributes.username
With these data elements in place, you are ready to start sending data to Platform Edge Network via the XDM object by creating a rule in tags.