This article will explain the steps that need to be taken to import conversion inside Datatrics. Using this import function, conversions and profiles will be created from your data.

Data examples

Here there are a couple of examples of conversion data you want to import can look like.

XML example:

<conversion>
<id>1</id>
<profileid>de02c53b</profileid>
<email>sbuckleigh0@test.ru</email>
<total>31.22</total>
<created>2020-04-28T14:08:45Z</created>
<items>
<item>
<id>984</id>
<price>9.26</price>
<quantity>1</quantity>
</item>
<item>
<id>117</id>
<price>8.73</price>
<quantity>3</quantity>
</item>
</items>
</conversion>

CSV example:

"profileid", "email", "naam", "voornaam", "achternaam", "land"
"13232", "test@test.nl", "Jan Test", "Jan", "Test", "Nederland"
"23234", "ander@test.nl", "Max Test", "Max", "Test", "Nederland"

Start the import

To start the import go to project settings and press ‘Custom Importer’. The following page should become visible:

Press the ‘Create Import’ button to start the next step.

Import Conversions

Once the process of importing has been selected the following page will appear:

Select Conversion here and give the import a fitting name. Special characters and spaces will be removed from the name. The source name that will be assigned is seen below.

After selecting the type and assigning the source name press on the next button.

Here there are two options available, uploading a CSV file from your local machine or load a URL that points to the XML feed.

When pressing the ‘upload file’ option your file explorer should open and you will be able to select a CSV file containing the conversions.

When pressing the url option a screen with different options that need to be filled in will appear.

The first option is ‘Element’, this is the name of the field that contains the conversion. When taking the XML example from the beginning of the article that would be ‘conversion’. Check your file to make sure that you select the correct element name.

The second is ‘Resource Location’, this expects the url that points to the XML feed. After filling in the URL it will try to retrieve the feed. Based on the response you will get a popup message saying if it succeeded or failed.

If the imported data is a URL, the option to select a frequency cap will be visible. The feed may change or have additional data every so often. Based on this you can select a time when the feed should be retrieved.

If the correct element has been chosen or the CSB file has been read correctly a drop down menu will appear enabling you to select the unique identifier for the given conversion. Select the correct id here. Ofter it is something like: id, orderid or conversionid. Depending on the name you gave the id.

Conversion mapping

The mapping of conversion can be divided into three parts: the conversion itself, profile information and items.

If the information is mapped correctly not only conversions can be created but also profiles that are linked to the conversion containing the correct items.

Example of mapping information to a profile:

Inside the dropdown there are options for different fields that can be assigned to the value.

In the example given above the fields ‘profileid’ and ‘email’ are assigned to a profile by using ‘profile.’ and adding the field where it belongs.

The profile based on the mapping will look like this:

[Image]

The first row are the values from the imported feed and the second row contains the options to select a key inside Datatrics where this value belongs.

{
"profileid": "profile.profileid",
"source": "Conversion_example",
"profile": {
"email": "email",
"name": "full_name",
"country": "country_code"
}
}

If the conversion contains more information you are free to add this using the profile. and then add the name of the field.

These profiles will also become visible inside Audience with the conversions inside the timeline of the profile.

Mapping conversion correctly will be done the same way as profile but instead of using profile. you will need to use conversion.

The information that is assigned to a conversion is only relevant for conversion, this can be a created date, total price or a total amount of products. These fields can be used for creating segments or inside the targeting.

The last part are the items that a conversion contains:

Everything inside the items list or information that items contain. The importer will look in case of a XML feed if it can read the ‘items.item.’ as an array. This means that all the items inside a conversion will be mapped based on the given ‘item.’.

If the feed is a CSV file it will combine all the items as long as the conversionid’s are the same. Meaning if you have two rows containing id 2, it will combine them as a single conversion with a list of items.

When all the mapping has been set correctly press ‘next’ and start the import.

The profiles should become visible inside the Audience with its own segment. The segment name is the same as the import name. Here you will find all the profiles created based on the conversion, inside this the timeline should show all the conversions connected to the profiles.

Did this answer your question?