Import a feed
If you’ve got your feed ready and it's available over the internet, the next step is to import your feed into Tweakwise.
To get your feed imported, we’re going to use Tweakwise’s tasks module. You need access to the Tweakwise app for this. If you don't already have access please contact our support team.
The feed import task
The tasks module allows you to configure different types of tasks, each with their own purpose and use. You won’t have to know the ins and outs of this module for this guide.
You can find the feed import task that was created for you by navigating to the tasks module (Connectivity → Tasks) and looking for a task named “Feed import”.
Creation
When your instance got created, two default tasks were already added for you. This includes a task that is able to import your feed named "Feed import". You can skip this step if you already have a feed import task.
If you do not have a feed import task we are going to create a new one.
To create a new task, click the "New task" button.
You'll be presented with a screen that allows you to give your task a custom name and select the type of task you want to create. To create a feed import task, make sure to select the "Import default feed" task type. For the name, you can fill in anything you like, as long as it makes it clear to you what it's purpose is. Generally we recommend something like "Feed import" or "Import data".
Configuration
There is a bit more to configure in our feed import task than the name and type. This is the next step in creating a task, but you can also configure an existing task anytime by clicking on the task in the tasks overview (Connectivity → Tasks).
We'll cover various aspects you can configure and points out some best practices in the upcoming sections.
Location and access
We're going to have to configure the feed import task so it knows where your feed can be found and how it can be accessed.
First, we'll need to configure the URL field. As covered in Make a feed available, your feed has to be available over the internet through either HTTP or FTP. Following that guide should have resulted in a URL that can now be used to tell the feed import task where to get your feed from. You can enter this URL in the HTTP URL field in the setup tab.
You might have chosen to secure your feed in order to ensure only trusted entities are able to read the feed. If your feed is protected with a username and password you can enter them under the setup tab as well.
After filling in the fields, you can try to test if Tweakwise is able to find and access your feed by clicking on the test button.
Test button shows error result
In some cases it is possible that we can download the feed, but the test button shows an error result. This is because the test button executes a different type of request to only retrieve metadata. We don't want to waste resources by downloading the complete feed when testing if we have access.
Your host may not support or actively block the type of request to retrieve the metadata (HEAD) and may only allow or support the type of request to download the feed (GET).
Additional feed validation
When Tweakwise imports your feed, it is validated to ensure not only the structure of the XML document is correct, but also the content is correct. An example of such a validation rule would be that all products are unique. This sort of validation is more extensive than what is covered in the Validate an XML feed guide.
Tweakwise provides some configurability over the validation done during import. For example, you can configure your feed import task to always ensure there are a certain number of products and categories in your feed.
It is a good practice to configure this. A bug in your feed generator could generate half a feed or omit products, causing your shop to be almost empty. Validation rules like these can prevent those scenarios from happening.
Besides having some products unavailable in your shop until the next correct import, they might also be deleted from some configurations. Taking a few seconds to think about these validations now can save you a lot of time in the future.
Email on failure
Keeping the data in your instance up-to-date is important. Having outdated data in your instance can cause various problems depending on your specific situation. It is recommended to setup the task so you'll receive an email if it fails. If you do not configure this, the feed import might fail for an extended period of time without you noticing.
Saving
At this point we have configured enough to import our feed manually for the first time. It is time to save the task, after which you'll be redirected back to the tasks overview.
Execution
With your feed import task in place, it now has to be run to actually import your feed into Tweakwise. To manually start the feed import, on the tasks overview, simply press the start button associated with the feed import task.
After a while, you'll see that your feed import task is being processed. Depending on the size of your feed, the download speed with which Tweakwise can download the feed, and other factors, it can takes seconds or minutes for the import to complete.
If the task ran successfully, you'll see that the most recently successful time in the table has been updated.
If the task exited with an error, you'll see a button appear which allows you to inspect what went wrong.
Opening the error will present you with a message telling you why your import failed. There are plenty of reasons why an import might fail. For example when the feed couldn't be found at the provided URL, when Tweakwise doesn't have access, but most commonly, when validation fails for the feed. Tweakwise tries to explain what went wrong and how you can fix it.
Although it may look intimidating at times, it can be quite simple. The following screenshot shows a simple message you can probably fix easily.
Product with article number 'TSH0123' is missing a name, so you add a name to that product in your product information management system and regenerate the feed.
Still, sometimes validation messages can be technical and hard to understand. If this is the case and you are unable to resolve the problem yourself, please don't hesitate to contact our support team.
Updated 5 months ago