# Product Data Transposition

## Product Data Transposition in the JENTIS Data Layer

When working with products or other repeatable data elements in JENTIS (such as multiple items in a shopping cart), you may have noticed that **products are pushed one by one** into the JENTIS Data Layer. However, in the **JENTIS Tag Manager (JTM)** interface, you interact with product properties like `Product ID`, `Product Name`, etc.—which are accessible as **arrays**.

This article explains how this **transposition** from objects to arrays works, and how to use it effectively in tags, triggers, and custom setups.

### Example: Multiple Products in Data Layer

Let’s start with a basic example where two products are pushed to the data layer:

```javascript
_jts.push({
  track: "product",
  type: "order",
  id: "123",
  name: "Baby Oil",
  group: ["Small Sortiment", "Baby"],
  brutto: 123.90
});

_jts.push({
  track: "product",
  type: "order",
  id: "456",
  name: "Baby Shampoo",
  group: ["Small Sortiment", "Baby"],
  brutto: 123.90
});
```

Each product is an individual object. But in the JENTIS Tag Manager, their attributes are **transposed into arrays**:

* **Product ID** → `["123", "456"]`
* **Product Name** → `["Baby Oil", "Baby Shampoo"]`

This makes it easy to handle multiple product values using a single variable.

### How Transposition Works

* Each property pushed in the `product` object becomes part of an **array of values**.
* These arrays are created per state and made accessible in JTM Variables.
* You can use them directly in tag configurations or trigger conditions.

### Using Arrays in Triggers

When using these variables in **triggers**, you must choose the correct operator for evaluating arrays.

For example:

* Trigger: Product Name **contains** `"Baby Oil"`

This will match against:

```json
["Baby Oil", "Baby Shampoo"]
```

✅ Use the **“contains”** operator for array-safe matching.

### Custom Properties

You can extend product objects with custom keys. For example:

```javascript
_jts.push({
  track: "product",
  type: "order",
  id: "123",
  name: "Baby Oil",
  variant: "Lotion"
});
```

To access this new `variant` property in JTM:

1. Go to **Variables** → **New Variable**
2. Choose **JTM Data Layer Value** (client-side)
3. Set the property name (e.g., `variant`)
4. Under **Merge Option**, select: `Join to Array (use Default Value)`

<figure><img src="https://2315305008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy15ncufYr341K5U8q6Of%2Fuploads%2Fgit-blob-c2d20b352e94626e87dfafa505da16880426aa1e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

This ensures that:

* All values are returned in array form
* The array length is consistent, even if a value is missing from some objects

### Summary

* Each product is pushed separately, but their properties are automatically grouped into arrays
* Use array-aware logic in triggers and tag setups
* Extend product objects freely with custom keys
* Always select proper merge options in JTM to ensure consistent behavior

For more on product schemas, refer to the [e-commerce-tracking](https://docs.jentis.com/data-capture/web-tracking-setup/set-up-jentis-data-layer/e-commerce-tracking "mention").
