Create an XDM schema for web data

Learn how to create an XDM schema for web data in the Adobe Experience Platform Data Collection interface.

Experience Data Model (XDM) schemas are the building blocks, principles, and best practices for collecting data in Adobe 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.

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 Adobe’s Experience Data Model. XDM provides prescriptive modeling for data that is common in the industry, while also allowing you to extend the model for your specific needs. Adobe 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.

NOTE
For demonstration purposes, the exercises in this lesson build an example schema to capture content viewed and products purchased by customers in the Luma Demo Site. While you can use these steps to create a different schema for your own purposes, it is recommended that you first follow along with creating the example schema to learn the capabilities of the schema editor.

To learn more about XDM schemas, take the course 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 Adobe 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 Luma Demo Site:

  1. Open the Data Collection interface

  2. 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.
  3. Go to Schemas in the left navigation

  4. Select the Create Schema button on the top right

    Create Schema

  5. Select Experience Event in the following screen

  6. Select Next

    Schema Experience Event

  7. 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.
  8. Select Finish

    Schema Experience Event Finsh

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 Adobe 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.

TIP
In this exercise, you add the recommended pre-defined field groups for web data collection: AEP Web SDK ExperienceEvent and Consumer Experience Event.
If you are only implementing Adobe Analytics with Web SDK and not sending any data to Experience Platform, use the Adobe Analytics ExperienceEvent Template field group to define the XDM schema. This is used in the Setup Analytics lesson.
  1. In the Field groups section, select Add

    New Field Group

  2. Search for AEP Web SDK ExperienceEvent

  3. Check the box

  4. Search for Consumer Experience Event

  5. Check the box

  6. Select Add field groups

    Add Field Group

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.

Schema Field Groups

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 Adobe 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.

Luma Web Event Data

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.

IMPORTANT
It is possible to enable Profile for a schema before saving your schema. Do not enable it at this point. Once a schema is enabled for Profile, it cannot be disabled or deleted without resetting the entire sandbox. Fields cannot be removed from schemas at this point either, although it is possible to Deprecate Fields in the UI. These implications are important to keep in mind later on when you are working with your own data in your Production environment.
This setting is discussed more during the Setup Experience Platform lesson.
Profile Schema

To complete this lesson, select Save on the top right.

Save Schema

Now, you are able to reference this schema when you add the Web SDK extension to your tag property.

Next: Configure an identity namespace

NOTE
Thank you for investing your time in learning about Adobe Experience Platform Web SDK. If you have questions, want to share general feedback, or have suggestions on future content, please share them on this Experience League Community discussion post
recommendation-more-help
8cbc0fd8-ca1d-433b-9c3d-bc3f113347d4