# Internal Search Tracking

## Internal Search Tracking

The `search` tracking type is used to capture internal search activity on your website. When a user performs a successful search and is presented with a result page, this command should be pushed to the JENTIS Data Layer.

This tracking helps to:

* Understand user search behavior
* Measure search performance
* Evaluate the quality of search results

### Tracking Commands

* `product` (for each result shown)
* `search`
* `submit`

### Example

```javascript
// Product results (example)
_jts.push({
  track: "product",
  type: "search",
  id: "123",
  name: "Ergonomic Chair"
});

_jts.push({
  track: "product",
  type: "search",
  id: "456",
  name: "Executive Leather Chair"
});

// Search metadata
_jts.push({
  track: "search",
  group: "global site search",
  term: "chair",
  countresults: 144,
  source: "headersearch",
  goal: "productlist"
});

// Submit state
_jts.push({ track: "submit" });
```

### Properties for `search`

| Name           | Description                                                                 | Type   | Mandatory | Example                |
| -------------- | --------------------------------------------------------------------------- | ------ | --------- | ---------------------- |
| `group`        | A meaningful group name for the search context                              | string | no        | `"global site search"` |
| `term`         | The search term input by the user                                           | string | yes       | `"chair"`              |
| `countresults` | Number of results returned by the search                                    | int    | no        | `144`                  |
| `source`       | Where the search was initiated (e.g., header, sidebar, etc.)                | string | no        | `"headersearch"`       |
| `goal`         | The type of content shown on the results page (e.g., productlist, CMS page) | string | no        | `"productlist"`        |

### Product Statement

Every product shown in the search results must be tracked individually using the `track: "product"` command and tagged with `type: "search"`. This ensures they are correctly associated with the `search` context.

#### Example Product

```javascript
_jts.push({
  track: "product",
  type: "search",
  id: "789",
  name: "Mesh Back Task Chair"
});
```

### Summary

* Track each product result with `type: "search"`
* Push one `search` object per search event
* Use `submit` to finalize the state

For product schema details, refer to the [E-Commerce Tracking](/data-capture/web-tracking-setup/set-up-jentis-data-layer/e-commerce-tracking.md).


---

# 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/internal-search-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.
