This article describes how to add context attributes to the Schema in the Evolv AI Manager.
Attributes from the session context must be mapped to the Schema using Source Fields.
Learn more: About the Schema
Creating a source field in the Schema
The following steps describe how to create a new field in the Schema.
- Navigate to the Schema page in the Manager
- Click Add Source Field at the bottom of the listing
- Enter the source field value and select a type from the dropdown.
The source field is the key for the value we expect to receive from the session context.
The type (string, boolean, number) tells the system which functions to make available in the audience builder.
- Enter the target field value and select a function from the dropdown.
The target field is what the source field maps to in the backend. You can keep this the same.
In the case of using the 'arrayagg' function, you might want to pluralize the source field. - Optionally, add additional target fields to process data in different ways
- Click Publish to All Environments at the top of the page to save and publish your changes.
See Setting values in your digital experience below for instructions on how to send values to Evolv AI from your digital experience.
Understanding different data processing functions
The system is able to process data it receives using different functions according to the type of data being sent. Processing the data in this way allows performance reports to be filtered by each defined target field.
Processing functions for fields with a ‘string’ type
Example of pages visited in a single session:
page_type: home |
page_type: plp |
page_type: pdp |
page_type: cart |
first_value | home |
last_value | cart |
Processing functions for fields with a ‘number’ type
Example of items added to the cart in a single session:
cart_item: 15.00 |
cart_item: 20.00 |
cart_item: 10.00 |
cart_item: 30.00 |
first_value | 15.00 |
last_value | 30.00 |
min | 10.00 |
max | 30.00 |
avg | 18.75 |
sum | 75 |
Setting values in your digital experience
In order for values to be received by the system, they must be set with their corresponding behaviors in your digital experience.
Values can be set using code from one of our SDKs. Below is an example using the Evolv Javascript SDK:
// String Value Example
evolv.context.set('my_source_field', 'value')
// Number Value Example
evolv.context.set('order_value', 15.00)