category and ontology, that can be supplied at the product level in the catalog import, 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 works well in product selections and filters. The ontology attribute is stricter, but is prioritized by the classification algorithms.
Consider the examples below:
A product can appear on pages other than one based on product-based categorization, such as a brand page, an inspiration page, or a sales page. While it’s fine to include these in the If you can’t extract a value for the
category attribute, avoid including them in the ontology attribute.ontology field, supplying all values to the category attribute works as a fallback, although quality will be reduced.If you need more detailed attributes, consider using custom attributes instead:Using categories to define pages
Thecategory attribute can be used to make product selections, for example to define pages — alternatively, a custom attribute can be used instead. If you use category for product selections, be careful with consistency around spacing. For example, gardening tools > chain saws is not the same page as gardening tools>chain saws. It’s also recommended to include all sub-paths so the product shows up on its parent pages too, for example:
gardening tools > chain saws, but then filters for pages high up in the hierarchy can get very large, since they need to list all leaf nodes — this can hurt performance and is harder to maintain.
For defining pages, the category attribute supports translations. This lets you use a stable ID for the category value alongside a human-readable name when selecting or presenting it. For example:
Categories as facets
Because of howcategories is formatted, it can’t be used as a facet. To enable category facets for visitors, use a custom attribute with a flat structure instead of a hierarchical one.
