> For the complete documentation index, see [llms.txt](https://docs.jentis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jentis.com/http-api-tracking/how-to-use-the-jentis-datalayer-state.md).

# How to use the JENTIS DataLayer State

{% hint style="info" %}
These properties and structures are required if you want to reuse the **JENTIS DataLayer State** within JENTIS. In this case, you must ensure that the properties follow the correct syntax expected by the JENTIS data processing backend.

To reference and submit the JENTIS DataLayer State, you must use the following initiator:

`jts_push_submit`
{% endhint %}

### jtspushedcommands

For every HTTP request sent to the JENTIS platform, the property **`jtspushedcommands`** must be included by default as an array.

When data is pushed to the DataLayer according to the JENTIS structure, all tracking commands must be added to the **`jtspushedcommands`** array within the JENTIS HTTP API request.

#### Example

The following data is pushed to the JENTIS data layer:

```javascript
_jts.push({
    "track": "pageview",
    "pagetitle": "Demo-APP Order Confirmed"
});

_jts.push({
    "track": "product",
    "type": "order",
    "id": "123",
    "name": "Testproduct",
    "brutto": 199.99
});

_jts.push({
    "track": "product",
    "type": "order",
    "id": "456",
    "name": "Testproduct 2",
    "brutto": 299.99
});

_jts.push({
    "track": "order",
    "orderid": "12345666",
    "brutto": 499.98,
    "paytype": "creditcard"
});
```

The property `jtspushedcommands` will have the following value:

```
jtspushedcommands : ["pageview","product","product","order","submit"]
```

### Product data

When tracking product data with the JENTIS HTTP Request, the tracked data must be brought into a format that the JENTIS Platform can understand. This format is identical to the one used in the web tracking environment.

Whenever the `track` command for “product” is used, all properties of each tracked product are concatenated into an array, with the prefix **“product\_”** added to each property in the HTTP request sent to JENTIS. This structure aligns with our approach of using an array list for tracking product data and supports filtering like in the web tracking environment.

#### Example

The following data is pushed to the JENTIS data layer:

```javascript
_jts.push({
    "track": "pageview",
    "pagetitle": "Demo-APP Order Confirmed"
});

_jts.push({
    "track": "product",
    "type": "order",
    "id": "123",
    "name": "Testproduct",
    "brutto": 199.99
});

_jts.push({
    "track": "product",
    "type": "currentcart",
    "id": "777",
  	"color": "green"
});

_jts.push({
    "track": "product",
    "type": "order",
    "id": "456",
    "name": "Testproduct 2",
    "brutto": 299.99
});

_jts.push({
    "track": "order",
    "orderid": "12345666",
    "brutto": 499.98,
    "paytype": "creditcard"
});

_jts.submit()
```

This example will generate the following properties in our HTTP-Request to JENTIS:

```
{
  "jtspushedcommands" : ["pageview","product","product","product","order","submit"],
  "pagetitle" : "Demo-APP Order Confirmed",
  "product_type" : ["order","currentcart","order"],
  "product_id" : ["123","777","456"],
  "product_name" : ["Testproduct 1","","Testproduct 2"],
  "product_brutto" : [199.99,"",299.99],
  "product_color" : ["","green",""],
  "orderid" : "12345666",
  "brutto" : 499.98,
  "paytype" : "creditcard"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jentis.com/http-api-tracking/how-to-use-the-jentis-datalayer-state.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
