Categories¶
When new products are imported into Elevate they are automatically analyzed and classified into different categories. By providing your own category data you can hint to the classifier which categories to look for and what hierarchies to use. Additionally, categories are useful when building your navigational page structure as each page can correspond to a unique category attribute value.
There are two attributes, category
and ontology
, that can be supplied on the product level in the data feed, and both are used to define hierarchical relationships between products. Each level in the hierarchy is defined by the greater than-sign, >
. The category
attribute is more generic, supports multiple values and translations, and is excellent to use in product selections and filters. The ontology
attribute is stricter, but will be prioritized by the classifier algorithms.
Consider the examples below:
"ontology": "power tools > chain saws"
"category": ["power tools > chain saws", "gardening tools > chain saws"]
Product-based categories
A product can be present on other pages than a page that is based on the product-based categorization, such as a brand page, an inspiration page, or a sales page. While it is fine to include these in the category
attribute, they should be avoided in the ontology
attribute.
"ontology": "gardening tools > chain saws"
"category": ["gardening tools > chain saws", "brands > husqvarna > chain saws", "inspiration >
trim your garden"]
If you can't extract the a value for the ontology
field, supplying all values to the category
attribute will work as a fallback, although the quality will be reduced.
Finally, you might want to consider using custom attributes if you need more detailed attributes:
"ontology": "gardening tools > chain saws"
"customLabels": {
"brandCategory": "brands > husqvarna > chain saws"
"inspirationalPages": "inspiration > trim your garden"
}
Using categories to define pages¶
The category
attribute can be used to make product selections (to e.g. define pages), alternatively a custom attribute can also be used for this. If using category
for product selections be careful with consistency when using spaces. For example, gardening tools > chain saws
is not the same page as gardening tools>chain saws
. It is also recommended to include all sub-paths so that the product shows up on its parent's pages e.g.
"category": ["gardening tools", "gardening tools > chain saws"]
The alternative is to only supply the leaf nodes, e.g. gardening tools > chain saws
, but then the filters for pages high up in the hierarchy can get very large since they need to list all the leaf nodes, which might hurt performance and is harder to maintain.
For the purpose of defining pages, the category
attribute have support for translations. This way you can have a stable id for the category value and a human readable name when selecting or presenting it. E.g.
{
"replace": {
"translation": {
"locale": "en-GB",
"attribute": "category",
"id": "c1_2",
"value": "gardening tools > chain saws"
}
}
}
Categories as facets¶
Because of the way categories
is formatted, it can't be used as a facet. To enable category facets for users, use a custom attribute with a flat structure, not a hierarchical one.