This document covers how to export valid category data to the Recommender Service.
Sending valid and matching category paths in the product catalog and Category commands are prerequisites for advanced recommendations like CATEGORY and HOME.
Note: There is no limit to the number of category hierarchies in Predict, but Smart Insight, which also uses the product catalog, accepts only the top five and ignores the rest.
Contents:
Category path
Products belong to a specific node in a category hierarchy. An online bicycle retailer might have the following category hierarchy, for example:
Bikes
Road Bikes
Mountain Bikes
Parts
Road
Tyres
Chains
MTB
Tyres
Chains
A category path denotes a single node in the category hierarchy. It is a >
-separated list of subcategories, starting with the top level category.
Bikes
and Bikes > Road Bikes
are valid category paths, while Road Bikes
is not, since it is not a top level category. Redundant (starting and trailing) white spaces are automatically removed, so Bikes > Road Bikes
is the same as Bikes > Road Bikes
.
For example, bike1
(being an awesome road bike) belongs to the broad category of Bikes
and to the specific subcategory Bikes > Road Bikes
. Our friendly neighborhood bike shop exports this relationship in their Product Catalog.
item, title, category,...
bike1, Awesome Road Bike, Bikes > Road Bikes, ...
They also send the correct category path on their category pages. They have the following Javascript snippet on their “Road bikes” page.
ScarabQueue.push(['category', 'Bikes > Road Bikes']);
Products in multiple categories
Sometimes a product can belong to multiple categories. Our bike shop sells pedal1
, a universal hybrid pedal which works on road bikes and mountain bikes. It belongs to both Parts > Road > Pedals
and Parts > MTB > Pedals
, so pedal1
belongs to a list of categories. Lists are |
-separated, e.g.:
item, title, category, ...
pedal1, Universal Hybrid Pedal, Parts > Road > Pedals | Parts > MTB > Pedals,...
In case there are multiple localized catalogs remember that the localized category structure needs to match exactly the category structure and order in the default category field.
Getting recommendations for specific categories
Our bike shop can restrict the scope of personalized recommendations using category recommenders. This works great on category pages and thematic newsletters.
On the website
Here’s the Javascript snippet from our merchant’s “parts for road bikes” category page.
ScarabQueue.push(['category', 'Parts > Road']);
ScarabQueue.push(['recommend', {
logic: 'CATEGORY'
}]);
This returns products from Parts > Road
, including all its subcategories.
In emails
Our bike shop has an event coming up called Tyre Friday, with huge discounts on all tyres. They create an email campaign with a Category recommendation logic and they set the category to the following category list.
Parts > Road > Tyres | Parts > MTB > Tyres