---
title: Schemas
slug: cpf/schemas
docTags: 
createdAt: 2024-02-12T06:06:02.657Z
---

## Context

Before you start configuring XDM Schema's and setting Primary Identifiers, we need to think about the business context of what we're trying to do:

- you want data
- you want to link data to a customer
- you want to build a progressive, real time customer profile

There are 2 types of data that we want to capture:

- who is this customer?&#x20;
- what does this customer do?

The question **Who is this customer?&#x20;**&#x69;s a very open question that has many answers. When your company wants to see this question answered, you’re looking for demographic information like First Name, Last Name and Address. But also for contact information like an Email Address or a Mobile Phone Number. And also for information linked to Language, OptIn/OptOut and maybe even Profile Pictures. And finally, what you really need to know, is how we’ll be identifying this customer in the various systems that your company uses.

The same thing goes for the question **What does this customer do?**. It’s a very open question with many answers. When your company wants to see this question answered, you’re looking for any interaction a customer has has had with any of your online and offline properties. Which pages or products have been visited? Has this customer added a product to his cart or even purchased an item? What device and browser has been used to browse the website? What kind of information is this customer looking for and how can we use that to configure and deliver a delightful experience to this customer? And finally, what we really need to know, is how we’ll be identifying this customer in the various systems that your company will use.

From a Schema perspective, the type of data to be collected controls which **class&#x20;**&#x74;he schema needs to be. The question: **Who is this customer?** is something that we define in the Class **XDM Individual Profile. &#x20;**

If you want to collect data to answer the question **What does this customer do?** then we need to use the class **XDM** **Experience Event.**

## Task

For this exercice, we will prepare a schema to import Transaction Data.&#x20;

Each profile can make multiple Transaction (1 Member to 0-Many Transaction), we want to keep this informatio nto know WHAT and WHEN a profile did. We need to use an experience Event class for that.&#x20;

the information we want to import are :&#x20;

1. Transaction ID (UUID)
2. Member ID (varchar 20)
3. Transaction Date (YYYYMMDD)
4. Amount (number)
5. Transaction Code (varchar 10)

We need to ensure we have attribute to store those informations. Adobe propose out of the box set of attributes (field group) to store the common information. You can also create custom attribute if needed.&#x20;

# Event schema for Transaction

## Create an Experience Event Schema

Click on **Schemas** in the menu on the left side of your screen. You’ll see the list of available Schemas.  To create a new schema, click on the button **Create schema&#x20;**&#x62;utton on the top right.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/h0LS-pU0qIgp3TSPjisuN_image.png)

This instance is able to manage relatoinal database, but this is not the topic for today. Select **Standard Schema**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/iMq3un_flYqzQ0c0r3ySP_image.png)

Next, we can use AI to create the schema for us. For this exercices we will create the schema manually. Select **Manual** &#x20;



![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/WE5ct3XQWOo2TVKs8MTCV_image.png)

Select **Experience Event&#x20;**&#x61;nd click **Next.**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/AjNPOCLzEEtjGxTsSrkEC_image.png)

Name your schema using the following pattern:

`[your name] - Transaction Schema`

Replace **your name** with your own. As an example:&#x20;

**John - Transaction Schema**

You can give your schema a description if you wish, then click **finish** to create the schema.&#x20;

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/ryONOZ5MNpZfDGBvoikv7_image.png)

You'll notice the \_id, timestamp and eventType fields are already part of your schema.  These are mandatory for all experience events and come as part of the class itself.  &#x20;

We will use:

- &#x20;\_id to store *Transaction ID*
- timestamp to store *Transaction Date*

**

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/_6CPygTkbe9qa-E9aVQfr_image.png)

In most cases you will want to add additional information to give more context about the interaction your customer had.  For this we'll use a field group.&#x20;

### Add field groups

Click on **+ Add&#x20;**&#x6E;ext to **Field groups** to add field groups to your schema.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/OY4mQ947V-wUZ-Mmny_u__image.png)

You can create new field groups to match your company requirements but Adobe also provides many out of the box field groups to save yourself some time.  For this exercise we'll use the default field groups:

- **Consumer Experience Event** to store transaction detail&#x20;
- **Person Identifier&#x20;**&#x74;o store profile ID

Search those fields group, select them, and click on **add field group**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/TOBT5T9X5PcWXys3PIBrc_image.png)

You can see a number of fields are now added into your schema automatically. &#x20;

We now have customer Id, and order detail with price, etc. This is enough to store the information we need.



![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/V_rMII9l5hx4Mo6fZjuCC_image.png)

### Set Identity Fields

Lastly we need to establish how we tie this event to our customer profile.   In some cases you want to flag individual fields which store the customer identities.  &#x20;

Select the **Person Identifier&#x20;**&#x66;ield group on the left panel, then select **personID&#x20;**&#x61;ttribute in mid pannel, and modify the property on the right panel. Check the box **Identity&#x20;**&#x61;nd **Primary Identity**, then select **DemoSystem CRMID** from the drop down list &#x20;

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/OVLf2g3VoOXMOLjm_eI3S_image.png)



**Apply** and **Save** your Schema.



:::hint{type="success"}
Congratulations, this completes the exercise on schemas
:::

