# 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: 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/http-api-tracking/how-to-use-the-jentis-datalayer-state.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.
