# JENTIS Data Layer Structure

{% hint style="warning" %}
By using the **JENTIS Data Layer**, you are automatically working with the default state called **“JENTIS Data Layer Send”** provided by the JENTIS DCP.\
For more information, read the [jentis-data-layer-state](https://docs.jentis.com/developer-guide/states/jentis-data-layer-state "mention").
{% endhint %}

JENTIS offers two primary approaches for integrating your website with its Tag Management System: **PUSH** and **PULL**. You can choose the method that best suits your technical setup and business requirements.

* **PUSH**: Your website actively sends data to JENTIS, allowing real-time delivery of specific parameters.
* **PULL**: JENTIS retrieves data directly from your website without requiring active input.

If you choose the **PUSH** method, it’s essential to understand how it works to ensure correct implementation. This article covers all key concepts and examples you need to get started.

### Automatic Tracking vs. Active Data Pushing

JENTIS automatically tracks many parameters out of the box, including data from browser APIs. However, **active data pushing** is necessary when you want to send dynamic information—such as product or user data—from your CMS or other systems.

The JENTIS platform is flexible, allowing you to enrich the data layer by pushing custom values and arguments as needed.

### Syntax

Data is pushed to JENTIS using the global array: `window._jts`. Here's the basic structure:

```
window._jts = window._jts || [];

_jts.push({
    "track": "<trackcommand>",
    "prop-1": "<prop-1-value>",
    "prop-2": "<prop-2-value>",
    "prop-n": "<prop-n-value>"
});
```

#### Reserved Properties

* `track`: **Required** in each push call. Defines the type of tracking.
* `type`: Used to associate a property (e.g. a product) with a certain interaction (e.g. `detailview`).

### When and What to Push

You can push data anytime before calling a `submit` command, which signals JENTIS to transmit the data to the server.

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

This command finalize the data layer and trigger all related processes—such as server-side transmission, trigger evaluations, and tag executions.

### Tracking Dependencies and Properties

#### Queue-Based Dependencies

All data pushed before the `submit` call belongs to the same "queue" or state. This allows you to group related information.

```
_jts.push({ "track": "pageview", "title": "Detailpage" });
_jts.push({ "track": "product", "type": "detailview", "name": "T-Shirt" });
_jts.push({ "track": "detailview" });
```

Here, the product is assigned to the `detailview` interaction.

#### Track Command-Based Dependencies

Each `track` command defines the context of the data being pushed. For example, multiple products must be pushed individually:

```
_jts.push({ "track": "product", "type": "listview", "name": "T-Shirt" });
_jts.push({ "track": "product", "type": "listview", "name": "Jeans" });
```

### Submitting Data

#### Auto Sending

The following command automatically send the data to the server:

* `track: "submit"`

#### Manual Submit

You can trigger data submission manually:

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

All prior `track` calls must occur before the `submit` call.

#### Using the Second Parameter

Pass `true` as the second parameter to send data immediately:

```
_jts.push({
  "track": "addtocart",
  "productid": "1234"
}, true);
```

### Resetting the Data Layer

You can manually reset the JENTIS Data Layer:

```
window.jentis.tracker.resetDatalayer();
```

This is useful if you want to clear the current state and prepare for a new tracking context.
