Data Prep for Data Collection
Data Prep is an 蜜豆视频 Experience Platform service that allows you to map, transform, and validate data to and from Experience Data Model (XDM). When configuring a Platform-enabled datastream, you can use Data Prep capabilities to map your source data to XDM when sending it to the Platform Edge Network.
All data sent from a web page must land in Experience Platform as XDM. There are 3 ways to translate data from an on-page data layer to the XDM accepted by Experience Platform:
- Reformat the data layer into XDM on the web page itself.
- Use the Tags native data elements functionality to reformat a web page鈥檚 existing data layer format into XDM.
- Reformat a web page鈥檚 existing data layer format into XDM via the Edge Network, using Data Prep for Data Collection.
This guide focuses on the 3rd option.
When to use Data Prep for Data Collection when-to-use-data-prep
There are two uses cases where Data Prep for Data Collection is useful:
- The website has a well-formed, governed, and maintained data layer and there is a preference for sending it directly to the Edge Network instead of using JavaScript manipulation to convert it to XDM on the page (either via Tags data elements or via manual JavaScript manipulation).
- A tagging system other than Tags is deployed on the site.
Send an existing data layer to the Edge Network via WebSDK send-datalayer-via-websdk
The existing data layer must be sent using the data
object within the sendEvent
command.
If you are using Tags, you must use the Data field of the Send Event action type, as described in the Web SDK tag extension documentation.
The rest of this guide will focus on how to map the data layer to XDM standards after it has been sent by the WebSDK.
This guide covers how to map your data within the UI. To follow along with the steps, start the process of creating a datastream up to (and including) the basic configuration step.
For a quick demonstration of the Data Prep for Data Collection process, refer to the following video:
Select data select-data
Select Save and Add Mapping after completing the basic configuration for a datastream, and the Select data step appears. From here, you must provide a sample JSON object that represents the structure of the data that you plan on sending to Platform.
To capture properties directly from your data layer, the JSON object must have a single root property data
. The subproperties of the data
object should then be constructed in a way that maps to the data layer properties that you want to capture. Select the section below to view an example of a properly formatted JSON object with a data
root.
data
rootcode language-json |
---|
|
To capture properties from an XDM object data element, the same rules apply to the JSON object, but the root property must be keyed as xdm
instead. Select the section below to view an example of a properly formatted JSON object with an xdm
root.
xdm
rootcode language-json |
---|
|
You can select the option to upload the object as a file, or paste the raw object into the provided textbox instead. If the JSON is valid, a preview schema is displayed in the right panel. Select Next to continue.
Mapping
The Mapping step appears, allowing you to map the fields in your source data to that of the target event schema in Platform. From here, you can configure the mapping in two ways:
- Create mapping rules for this datastream through a manual process.
- Import mapping rules from an existing datastream.
Create mapping rules create-mapping
To create a mapping rule, select Add new mapping.
Select the source icon ( ), and in the dialog that appears select the source field that you want to map in the provided canvas. Once you have chosen a field, use the Select button to continue.
Next, select the schema icon ( ) to open a similar dialog for the target event schema. Choose the field that you want to map the data to before confirming with Select.
The mapping page reappears with the completed field mapping shown. The Mapping progress section updates to reflect the total number of fields that have been successfully mapped.
[*]
after the array name in the source and destination field paths, as shown below.Import existing mapping rules import-mapping
If you have previously created a datastream, you can reuse its configured mapping rules for a new datastream.
To start, select Import Mapping.
In the dialog that appears, select the datastream whose mapping rules you want to import. Once the datastream is chosen, select Preview.
The next screen shows a preview of the saved mapping rules for the selected datastream. Make sure that the displayed mappings are what you expect, and then select Import to confirm and add the mappings to the new datastream.
Complete the mapping
Continue following the above steps to map the rest of the fields to the target schema. While you do not have to map all available source fields, any fields in the target schema that are set as required must be mapped to complete this step. The Required fields counter indicates how many required fields are not yet mapped in the current configuration.
Once the required field count reaches zero and you are satisfied with your mapping, select Save to finalize your changes.
Next steps
This guide covered how to map your data to XDM when setting up a datastream in the UI. If you were following general datastreams tutorial, you can now return to the step on viewing datastream details.