Content Importer

This article will explain the steps that need to be taken to import content inside Datatrics.

Development Datatrics avatar
Written by Development Datatrics
Updated over a week ago

This article will explain the steps that need to be taken to import content inside Datatrics. By using this import function, content will be created from your data.

Data examples

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

XML example:

<?xml version="1.0" encoding="UTF-8"?>
<items>
<item> #element name used for the importer
<name>Red shoe</name>
<category>Shoes</category>
<id>1234</id>
</item>
<item>
<name>Blue jeans</name>
<category>Jeans</category>
<id>1235</id>
</item>
</items>

Check out this article to view an inspirational e-commerce feed.

CSV example:

id,name,description,price	         #The header of the CSV file
1,test name,short description,12.50 #A row with values
....
....

Start the import

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

Click on the "Create Import" button to start the process and select "Content".

Choose between XML and CSV

As soon as you select content, a new screen will open where you can choose between uploading a file (this must always be a CSV file) or Loading a file from an URL (this must always lead to an XML file).

Uploading a CSV file
To upload a CSV file, click on the large box "Upload file". This will open your computer's explorer to select a file. After selecting click on "Okay", the "Next" button will become available once the file is correctly uploaded.

Loading an XML file from a URL
For loading an XML file there are a number of fields that need to be filled in correctly.

Enter in the "Element" field the name of the tag that contains all the information of the individual product and, in "Resource Location", the URL of the XML file.

As soon as the content has been retrieved, the icon on the right of the input field will change to a green checkmark. If something has gone wrong, an error message will appear. This may have something to do with the "Element" field.

An XML file consists of several elements that are put together in a file. Type the name of the element where a single content item starts. Then click “Enter” on your keyboard. This will fetch the file again.

When the XML file has been uploaded correctly, a new element will be shown. In this element, you can define how often the XML file should be updated.

Basic settings for the import

As soon as the chosen type of file is retrieved correctly, an overview will be displayed as shown in the figure below. Here you can enter a name for the import, what the item type is, and you can choose (or create) the unique identification field of the item.

Item types
The custom importer allows the import of different item types:

Content: The items for sale on the website.

Conversions: The conversions made by users.

Returns: The data on returns made by customers.

Profile: The information on registered users.

Unique identifier
Each item in Datatrics’ content has a unique identifier with which an item can be found. Depending on the header or keys found in the import file, you can choose one of these to be used as an id. Often these are already called "id" or "Product ID" in most feeds.

If there is no unique value in the file that can be used as a unique key, the Datatrics generated value can also be chosen.

Mapping the data
After choosing a name, id and type, the fields listed in the feed must be mapped or connected to the fields that will be used within Datatrics.

When the page is loaded, it will contain different rows depending on the loaded document. Every row has the following five columns:

You can find the explanation per column below:

1. Here, you can indicate whether or not the field should be imported.

2. The name of the field according to the loaded file.

3. The name of the new field to be used within Datatrics. A name will be entered here by default. This is the name of the loaded file but without capital letters and no break spaces. Here is the possibility to give a name of your own, to leave the name as is, or to link one of the Datatrics fields to it by clicking on it. Using Datatrics fields as much as possible is strongly recommended. The Datatrics fields are the basic fields that are often used within the platform. These do not all have to be used but use them where possible.

In the table below you can find the Datatrics fields.

A Datatrics field will always fix a type to the type expected for the field. As shown in the example below, this type cannot be changed because the field 'name' is a Datatrics exclusive field.

4. If you have entered your own field name, you can choose from a number of types to assign to that field.

Repeat these five options for all the rows! When all this is done you can click on the “Next” button in the top right corner.

Finish the import

The next page is the last page. It shows how many fields have been selected for the import and the name of the import.

Click on "Start Import" to finish the process.

Now, wait for the process to be completed. This can take up to 15 minutes. 

When the import is completed, the loading icon will change to a checkmark and the total number of imported items will be displayed.

Finding your content

To view the imported data, head over to content. The content should be visible here. Click on the collection with the name of the import to only see the items created by the import.

Did this answer your question?