> ## Documentation Index
> Fetch the complete documentation index at: https://product-discovery.developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Categories

> How to provide category data so Elevate can better understand your products.

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 which hierarchies to use. Categories are also useful when building your navigational page structure, since each page can correspond to a unique category attribute value.

There are two attributes, `category` and `ontology`, that can be supplied at the [product level in the catalog import](/elevate/docs/api/admin/v4/import/catalog#productdata), 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:

```json icon="code" theme={null}
"ontology": "power tools > chain saws"
"category": ["power tools > chain saws", "gardening tools > chain saws"]
```

<Note>
  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 `category` attribute, avoid including them in the `ontology` attribute.

  ```json icon="code" theme={null}
  "ontology": "gardening tools > chain saws"
  "category": ["gardening tools > chain saws", "brands > husqvarna > chain saws", "inspiration > trim your garden"]
  ```

  If you can't extract a value for the `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:

  ```json icon="code" theme={null}
  "ontology": "gardening tools > chain saws"
  "customLabels": {
      "brandCategory": "brands > husqvarna > chain saws",
      "inspirationalPages": "inspiration > trim your garden"
  }
  ```
</Note>

## Using categories to define pages

The `category` attribute can be used to make product selections, for example to define [pages](https://help.elevate.voyado.com/hc/en-gb/articles/27611164840092-Category-Landing-pages) <Icon icon="external-link" size={12} /> — 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:

```json icon="code" theme={null}
"category": ["gardening tools", "gardening tools > chain saws"]
```

The alternative is to supply only the leaf nodes, 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](/elevate/docs/integration/catalog-imports/format-overview#translation). This lets you use a stable ID for the category value alongside a human-readable name when selecting or presenting it. For example:

```json icon="code" theme={null}
{
  "replace": {
    "translation": {
      "locale": "en-GB",
      "attribute": "category",
      "id": "c1_2",
      "value": "gardening tools > chain saws"
    }
  }
}
```

## Categories as facets

Because of how `categories` 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.
