Create an XDM schema for web data
Learn how to create an XDM schema for web data in the ÃÛ¶¹ÊÓƵ Experience Platform Data Collection interface.
Experience Data Model (XDM) schemas are the building blocks, principles, and best practices for collecting data in ÃÛ¶¹ÊÓƵ Experience Platform.
Platform Web SDK uses your schema to standardize your web event data, send it to the Platform Edge Network, and ultimately forward the data to any Experience Cloud applications configured in the datastream. This step is critical as it defines a standard data model required for ingesting customer experience data into Experience Platform and enables downstream services and applications built on these standards.
data
object instead of the xdm
object as you will see later). An XDM schema is required for the most performant implementations of Platform-native applications like Journey Optimizer, Real-Time Customer Data Platform, Customer Journey Analytics. While you may decide not to use an XDM schema in your own implementation, you are expected to do so as part of this tutorial.Why model the data?
Businesses have their own language for communicating about their domain. Car dealerships deal with makes, models, and cylinders. Airlines deal with flight numbers, class of service, and seating assignments. Some of these terms are unique to a specific company, some are shared among an industry vertical, and some are shared by almost all businesses. For terms that are shared among an industry vertical or even broader, you can start doing powerful things with your data when you name and structure these terms in a common way.
For example, many businesses deal with orders. What if, collectively, these businesses decided to model an order in a similar way? For example, what if the data model consisted of an object with a priceTotal
property that represented the total price of the order? What if that object also had properties named currencyCode
and purchaseOrderNumber
? Maybe the order object contains a property named payments
that would be an array of payment objects. Each object would represent a payment for the order. For example, perhaps a customer paid for part of the order with a gift card and the rest using a credit card. You can start to construct a model that looks something like this:
{
"order": {
"priceTotal": 89.50,
"currencyCode": "EUR",
"purchaseOrderNumber": "JWN20192388410012",
"payments": [
{
"paymentType": "gift_card",
"paymentAmount": 50
},
{
"paymentType": "credit_card",
"paymentAmount": 39.50
}
]
}
}
If all businesses dealing with orders decided to model their order data in a consistent way for terms that are common in the industry, magical things could start to happen. Information could more fluidly be exchanged inside and outside your organization instead of constantly interpreting and translating the data (props and evars, anyone?). Machine learning could more easily understand what your data means and provide actionable insights. User interfaces for surfacing relevant data could become more intuitive. Your data could be seamlessly integrated with partners and vendors who are following the same modeling.
This is the goal of ÃÛ¶¹ÊÓƵ’s . XDM provides prescriptive modeling for data that is common in the industry, while also allowing you to extend the model for your specific needs. ÃÛ¶¹ÊÓƵ Experience Platform is built around XDM and, as such, data sent into Experience Platform needs to be in XDM. Rather than thinking about where and how you can transform your current data models into XDM before sending the data to Experience Platform, consider more pervasively adopting XDM across your organization so that translation rarely needs to occur.
To learn more about XDM schemas, watch the playlist Model Your Customer Experience Data with XDM or see the XDM System overview.
Learning objectives
At the end of this lesson, you will be able to:
- Create an XDM schema from within the Data Collection interface
- Add field groups to your XDM schema
- Create XDM schemas for web event data using best practices
Prerequisites
All necessary provisioning and user permissions for Data Collection and ÃÛ¶¹ÊÓƵ Experience Platform described on the overview page.
Create an XDM schema
XDM schemas are the standard way to describe data in Experience Platform, allowing all data that conforms to the schemas to be reused across an organization without conflicts, or even shared between multiple organizations. To learn more, see the basics of Schema composition.
In this exercise, you will create an XDM schema using the recommended baseline field groups for capturing web event data on the :
-
Open the
-
Ensure you are in the correct sandbox. Locate the sandbox in the upper right corner
note note NOTE If you are the customer of a Platform-based application like Real-Time CDP or Journey Optimizer, we recommend using a development sandbox for this tutorial. If you are not, use the Prod sandbox. -
Go to Schemas in the left navigation
-
Select the Create Schema button on the top right
-
Select Experience Event in the following screen
-
Select Next
-
Enter the name for your schema under Schema display name field, in this case
Luma Web Event Data
note tip TIP A common naming convention for XDM schemas is to name the schema after the source of the data. -
Select Finish
Add field groups
As noted earlier, XDM is the core framework that standardizes customer experience data by providing common structures and definitions for use in downstream ÃÛ¶¹ÊÓƵ Experience Platform services. By adhering to XDM standards, all customer experience data can be incorporated into a common representation. This approach allows you to gain valuable insights from customer actions, define customer audiences through segments, and express customer attributes for personalization purposes using data from multiple sources. See Best practices for data modeling for more information.
When possible, it is recommended to use existing field groups and adhere to a product-agnostic model and naming conventions. For any data specific to your organization that does not fit into the pre-defined field groups above, you can create a custom field group. See Creating a schema using the Schema Editor for more detailed steps on custom schemas.
-
In the Field groups section, select Add
-
Search for
AEP Web SDK ExperienceEvent
-
Check the box
-
Search for
Consumer Experience Event
-
Check the box
-
Select Add field groups
With both field groups, notice that you have access to the most commonly used key-value pairs required for data collection on the web. The display name of each field appears to marketers in the segment builder interface of Platform-based applications and you can change the display name of standard fields to suit your needs. You can also remove fields you don’t want. When you click on either field group name, the interface highlights what key-value pair groupings belong to it. In below example, you see what fields belong to Consumer Experience Event.
This lesson is just a starting point. When building your own web events schema, you must explore and document your business requirements. This process is similar to creating a Business Requirements Document and Solution Design Reference for an ÃÛ¶¹ÊÓƵ Analytics implementation, but should include requirements for all downstream data recipients such as Platform, Target, and event forwarding destinations.
The identityMap object
There is a special field used to identify web users called identityMap
.
It is a must-have object for any web-related data collection, as it houses the Experience Cloud ID required for identifying users on the web. It is also the key to setting internal customer IDs for authenticated users. identityMap
is discussed more in the Configure Identities lesson. It is automatically included in all schemas using the XDM ExperienceEvent class.
To complete this lesson, select Save on the top right.
Now, you are able to reference this schema when you add the Web SDK extension to your tag property.
Next: Configure an identity namespace