# Category Tracking

## Category Tracking

Use the `category` and `categoryview` tracking commands to capture when a visitor views a page that presents product categories. This improves the accuracy of interaction tracking for product catalog, category landing pages, or filtered category views.

### Purpose

Category tracking:

* Signals that the user is browsing a **category page**
* Enables better segmentation and reporting on **category-level interactions**

### Tracking Commands

* `category` (for each category shown)
* `product` (if any products are displayed)
* `categoryview` (once per page)
* `submit` (finalizes the state)

### 1. `category` Object

Push one `category` object for each category shown on the page.

#### Mandatory Properties

| Name   | Description                     | Type   | Example       |
| ------ | ------------------------------- | ------ | ------------- |
| `id`   | Internal identifier of category | string | `"C8"`        |
| `name` | Display name of the category    | string | `"Furniture"` |

#### Example

```javascript
_jts.push({
  track: "category",
  id: "C8",
  name: "Furniture"
});
```

### 2. `categoryview` Command

Push this command **once**, after all `category` and `product` pushes are complete.

#### Example

```javascript
_jts.push({
  track: "categoryview"
});
```

No additional properties are required.

***

### Full Example

```javascript
// [START] General Pageview
_jts.push({ track: "pageview" });

// [CATEGORY] Category information
_jts.push({
  track: "category",
  id: "C8",
  name: "Furniture"
});

// [PRODUCTS] Products shown under the category
_jts.push({ track: "product", type: "categoryview", id: "1" });
_jts.push({ track: "product", type: "categoryview", id: "2" });

// [CATEGORYVIEW] Category view summary
_jts.push({ track: "categoryview" });

// [SUBMIT] Final submission
_jts.push({ track: "submit" });
```

### Summary

* Use one `category` push per category displayed
* Trigger `categoryview` once to finalize the interaction
* Include any `product` pushes if products are shown under categories
* Finalize the interaction state with a `submit`

This approach ensures category pages are clearly marked and measurable across your tracking stack.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/data-capture/web-tracking-setup/set-up-jentis-data-layer/e-commerce-tracking/category-tracking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
