# Hits list

{% hint style="warning" %}
Read me! If you're here, it's probably because you're wondering how to send data to AB Tasty's collect API.\
There's a lot of info in this page, you will most likely be interested by the second half of this documentation labelled as **Custom tracking** in the table of contents below.
{% endhint %}

### Hits list

Each hit type has its specific set of argument rules, that you should check through those links:

**Automatically sent by the Javascript tag:**

* [campaign](#campaign)
* [pageview](#pageview) (or 'screen' for mobile apps)
* [datalayer](#datalayer)
* [batch](#batch) (batches of other hits)

**Custom trackings:**

* [event](#event)
* [segment](#segment)
* [transaction](#transaction)
* [item](#item)
* [nps](#nps)
* [product](#product)

### Automatically sent

#### Campaign

{% tabs %}
{% tab title="JavaScript" %}

```
const campaignID = "267276";
const variationID = "873378";

window.abtasty.send("campaign", {
  caid: campaignID,
  vaid: variationID
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST   https://ariane.abtasty.com   -H 'Content-Type: text/plain'   -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36'  -H 'Postman-Token: 0d1d0de3-30d3-406a-85a1-90598b03ad87'   -H 'cache-control: no-cache'   -d '{
    "caid": "267276",
    "vaid": "873378",
    "cid": "60511af14f5e48764b83d36ddb8ece5a",
    "t": "CAMPAIGN",
    "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

Generated hit headers:

```javascript
{
"caid": "267276",
"vaid": "873378",
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"t": "CAMPAIGN",
"vid": "18100217380532936"
}
```

```shell
// A binary file ariane_response.tmp will be generated.
```

This hit should be sent every time a visitor is submitted to a campaign.

Campaign hits are automatically triggered by the Javascript tag with the `window.abtasty.send` function. However, you may want to trigger hits manually. For that, just put the function in your code.

\[Tag-specific] Hit is automatically sent every time a campaign is applied to the visitor.

**Common arguments**

* A *campaign* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`campaign`'**

**Campaign ID**

The campaign ID is the ID of the test.

Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterCampaignID for this argument.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **caid**  | string     | *None*        | *None*     | campaign            |

Example usage: `caid="262762"`

**Variation ID**

The variation ID associated to the campaignID seen by the user.

Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterVariationID for this argument.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **vaid**  | string     | *None*        | *None*     | campaign            |

Example usage: `vaid=287622`

***

#### Pageview

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("pageview", {});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "t": "PAGEVIEW",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

Generated hit headers

```javascript
{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "t": "PAGEVIEW",
  "vid": "18100217380532936"
}
```

```shell
A binary file ariane_response.tmp will be generated.
```

This hit should be sent every time the visitor arrives on a new page (or 'screen' for mobile apps).

\[Tag-specific] - Hit is automatically sent every time the url changes (valid also for SPA).

Page hits are automatically triggered by the Javascript tag. However, you may want to trigger hits manually on some cases.

**Common arguments**

* A *pageview* hit **must implement** the [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`pageview`'**

**Redirection exception**

When the current page is the target of a redirection, two specifics arguments will be sent to cancel this pageview on the data pipeline collection.

**Post-edit Action**

String of a post edit action. Used for redirection data correction.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pea**   | string     | *None*        | *None*     | pageview            |

**Post-edit Value**

Post-edit View. Used with pea. String of a logicalView, target of the post-edit action. Used for redirection data correction.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pev**   | string     | *None*        | *None*     | pageview            |

***

#### Datalayer

{% tabs %}
{% tab title="JavaScript" %}

<pre><code><strong>window.abtasty.send("datalayer", {
</strong>  dlr: {
    userType: "premium",
    userSex: "female"
  }
  // you can also override other arguments here
});
</code></pre>

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com/datalayer \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "dlr": {"userType": "premium", "userSex": "female"}
  "t": "DATALAYER",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

> Type of response you will have

```javascript
// 200 OK
```

```shell
// A binary file ariane_response.tmp will be generated.
```

This hit is used to get user segments (e.g. DMP) in order to improve user targeting, segmentation, and enrich campaign reporting interfaces.

**Endpoint**

The datalayer hit has a different endpoint (i.e. `/datalayer`) than the others hits.

**Common arguments**

* A *datalayer* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`DATALAYER`'**

**Required for datalayer hit type**

The content of the datalayer variable

| Parameter | Value Type   | Default Value | Max Length | Supported hit types |
| --------- | ------------ | ------------- | ---------- | ------------------- |
| **dlr**   | object/array | *None*        | *None*     | datalayer           |

Examples of values:

* `{"userType": "premium", "userSex": "female"}`
* `[{"userType": "premium", "userSex": "female"},{"pageType":"homepage","env":"prod"}]`

Example usage: `dlr={"userType": "premium", "userSex": "female"}`

**Client-side implementation**

The Datalayer hit is not automatically triggered for all the visitors. We implement a random value to send it for 1% of the viewed pages.

***

#### Batch

{% tabs %}
{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com/ \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
        "c": {"342395": "0","339303": "0"},
        "cid": "60511af14f5e48764b83d36ddb8ece5a",
        "vid": "18100217380532936",
        "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
        "h": [
          {
            "qt": 700,
            "t": "PAGEVIEW"
          },
          {
            "caid": "267276",
            "vaid": "873378",
            "qt": 200,
            "t": "CAMPAIGN"
          }
        ],
        "t": "BATCH"
      }' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

> Type of response you will have

```javascript
// 200 OK
```

```shell
// A binary file ariane_response.tmp will be generated.
```

This is a special type of hits used to form **batches of other hits** and *thus isn't a processable hit in itself*.

Upon reception, the pipeline will unpack the batch by merging all its informations with its children, then the child hits will be processed as if they were sent separately.

In the previous example **two hits will be processed**: a PAGEVIEW hit and a CAMPAIGN hit

Both hits will be composed with all the informations contained at the batch level except the argument `"h"` which contains the **batch's child hits**:

```javascript
{
    "c": {"342395": "0","339303": "0"},
    "cid": "60511af14f5e48764b83d36ddb8ece5a",
    "vid": "18100217380532936",
    "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
    "t": "PAGEVIEW"
}
```

```javascript
{
    "c": {"342395": "0","339303": "0"},
    "cid": "60511af14f5e48764b83d36ddb8ece5a",
    "vid": "18100217380532936",
    "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
    "caid": "267276",
    "vaid": "873378",
    "t": "CAMPAIGN"
}
```

The child hit's timestamps will be calculated upon reception using the `"qt"` argument. Its value represents the *time delta* (in milliseconds) between the moment the *child hit occured* and the moment the *batch was sent*.

**Common arguments**

* A *batch* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`BATCH`'**

**Required for batch hit type**

The batch can contain all informations its it children have in common except `"t"` and `"qt"`.

| Parameter | Value Type       | Default Value | Max Length | Supported hit types |
| --------- | ---------------- | ------------- | ---------- | ------------------- |
| **h**     | array of objects | *None*        | *None*     | batch               |

Example of values:

* `[{"qt": 700, "t": "PAGEVIEW"},{"qt": 500, "t": "PAGEVIEW"},{"qt": 7100, "t": "PAGEVIEW"}]`

Example usage: `h=[{"qt": 700, "t": "PAGEVIEW"},{"qt": 500, "t": "PAGEVIEW"},{"qt": 7100, "t": "PAGEVIEW"}]`

**Required for the batch's children**

The batch's children may ommit all informations they have in common by moving those on the *batch level*.

The `"qt"` value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The `"qt"` value must be greater than or equal to 0.

*Values greater than four hours may lead to hits not being processed.*

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **qt**    | integer    | *None*        | *None*     | batch children      |

### Custom Trackings

#### Event

An event can be anything you want, from a click to a newsletter subscription. It basicallys says: "something happened". It will be used as an (Custom) Action Tracking goal in AB Tasty's reporting.

If you're wanting to track *something*, that's probably what you want to implement.

You can also trigger an `Event` using the following function from the tag:\
`ABTastyClickTracking('eventName', null, 'testId')`

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("event", {
  ec: "Action Tracking",
  ea: "Click on CTA",
  el: "CTA on product page",
  ev: 1
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ec": "Action Tracking",  
  "ea": "Click on CTA",
  "el": "CTA on product page",
  "ev": 1,
  "t": "EVENT",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* A *event* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument `t` (type) **must be set to '`event`'**

**Event Category**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ec**    | string     | *None*        | 150 Bytes  | event               |

* Example usage: `ec=Action Tracking`

{% hint style="info" %}
The `ec` parameter must be equal to `"Action Tracking"` for common usage. You are still able to send the category you want but it will not be computed and displayed in the reporting.
{% endhint %}

**Event Action**

This corresponds to the display name of an Action Tracking goal in the AB Tasty platform.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ea**    | string     | *None*        | 500 Bytes  | event               |

* Example usage: `ea=Click on CTA`

**Event Label**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **el**    | string     | *None*        | 500 Bytes  | event               |

* Example usage: `el=CTA on product page`

**Event Value**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ev**    | int (>0)   | *None*        | 500 Bytes  | event               |

* Example usage: `ev=1`

***

#### Segment

This hit is used to share you user segments (think: DMP) with ABTasty in order to enrich your campaigns reportings.\
This will be referred as "visitors attributes" in the reporting interface, not to be confused with the "segments" [you can create in the interface](https://docs.abtasty.com/integrations/push-integrations/segment) that are a set of saved targetings.

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("segment", {
  s: {
    userType: "premium",
    userSex: "female"
  }
  // you can also override other arguments here
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "s": {"userType": "premium", "userSex": "female"},
  "t": "SEGMENT",
  "vid": "18100217380532936",
}'--output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* A *segment* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`segment`'**

**Segments**

Any number of segments (key/value).

| Parameter          | Value Type | Default Value | Max Length | Supported hit types |
| ------------------ | ---------- | ------------- | ---------- | ------------------- |
| **s\[segmentKey]** | string     | *None*        | 150 Bytes  | segment             |

Example usage: `s[userprivilege]=premium`

***

#### Transaction

A transaction hit, referred as "transaction tag", is set by the customer to be sent whenever a visitor completes a transaction.\
It is usually implemented on a payment confirmation page but can be use elsewhere to send transactional data and doesn't require a transaction value.

This will populate a transaction goal in the AB Tasty platform.

A transaction can be linked to other `Item` hits to specify the products of the transaction (see [#item](#item "mention")).

{% hint style="info" %}
For currency conversion purposes, all prices will be multiplied by 10e6 in the data pipeline.
{% endhint %}

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("transaction", {
  tid: "OD564",         //Transaction ID
  ta: "Purchase",         //Transaction Affiliation - Name of the transaction goal
  tr: 15.47,            //Transaction Revenue
  ts: 3.5,              //Transaction Shipping
  tt: 2.60,             //Transaction Tax
  tc: "EUR",            //Transaction Currency
  tcc: "Coupon",        //Transaction Coupon Code
  pm: "Paypal",         //Transaction Payment Method
  sm: "Fedex",          //Transaction Shipping Method
  icn: 12               //Number of items
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "icn": 12,
  "pm": "Paypal",
  "sm": "Fedex",
  "t": "TRANSACTION",
  "ta": "Purchase",
  "tc": "EUR",
  "tcc": "Coupon",
  "tid": "OD564",
  "tr": 15.47,
  "ts": 3.5,
  "tt": 2.6,
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* A *transaction* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`transaction`'**

**Transaction ID**

The transaction ID.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **tid**   | string     | *None*        | 500 Bytes  | transaction, item   |

Example usage: `tid=OD564`

**Transaction affiliation**

Specifies the affiliation or store name. This will be the name of your transaction goal.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ta**    | string     | *None*        | 500 Bytes  | transaction         |

Example usage: `ta=Purchase`

**Transaction revenue**

Specifies the total revenue associated with the transaction. This value should include any shipping or tax costs.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **tr**    | float      | 0             | *None*     | transaction         |

Example usage: `tr=15.47`

**Transaction shipping**

Specifies the total shipping cost of the transaction.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ts**    | float      | 0             | *None*     | transaction         |

Example usage: `ts=3.50`

**Transaction tax**

Specifies the total tax of the transaction.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **tt**    | float      | 0             | *None*     | transaction         |

Example usage: `tt=2.60`

**Transaction currency**

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **tc**    | string     | *None*        | 10 Bytes   | transaction         |

Example usage: `tc=EUR`

**Payment Method**

Indicate the payment method.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pm**    | string     | *None*        | 10 Bytes   | transaction         |

Example usage: `pm="Paypal"`

**Shipping Method**

Indicate the shipping method.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **sm**    | string     | *None*        | 10 Bytes   | transaction         |

Example usage: `sm="express"`

**Item count number**

Indicate the number of items in the transaction.

By default, the value will be `1` unless `ITEM` hits are attached to this transaction (binded with `tid`). In that case, this parameter will be equal to the sum of all attached `ITEM` hits.

| Parameter | Value Type | Default Value                    | Max Length | Supported hit types |
| --------- | ---------- | -------------------------------- | ---------- | ------------------- |
| **icn**   | int        | 1 or sum of attached `ITEM` hits | *None*     | transaction         |

Example usage: `icn=12`

***

#### Item

Item usually represents a product. An item must be associated with a transaction by its transaction ID (see[https://gitlab.com/abtasty/team/product-management/gitbook-documentation/-/blob/main/developers-doc/data/universal-collect/broken-reference/README.md](https://gitlab.com/abtasty/team/product-management/gitbook-documentation/-/blob/main/developers-doc/data/universal-collect/broken-reference/README.md "mention")).

{% hint style="info" %}
For currency conversion purposes, all prices will be multiplied by 10e6 in the data pipeline.
{% endhint %}

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("item", {
  tid: "OD564",     //transaction ID
  in: "Shoe",       //Item Name
  ip: 3.5,          //Item Price
  iq: 4,            //Item Quantity
  ic: "SKU47",      //Item Code (SKU)
  iv: "Blue"        //Item Category
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ic": "SKU47",
  "in": "Shoe",
  "ip": 3.5,
  "iq": 4,
  "iv": "Blue",
  "t": "ITEM",
  "tid": "OD564",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* An *item* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`item`'**

**Transaction ID**

{% hint style="warning" %}
The `transaction` hit matching the `tid` argument must have been triggered beforehand or the hit will not be sent.
{% endhint %}

The transaction ID. This argument links the item to a transaction

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **tid**   | string     | *None*        | 500 Bytes  | transaction, item   |

Example usage: `tid=OD564`

**Item Name**

Specifies the item name.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **in**    | string     | *None*        | 500 Bytes  | item                |

Example usage: `in=Shoe`

**Item Code**

Specifies the SKU or item code.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ic**    | string     | *None*        | 500 Bytes  | item                |

Example usage: `ic=SKU47`

**Item Price**

Specifies the price for a single item / unit.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ip**    | float      | 0             | *None*     | item                |

Example usage: `ip=3.50`

**Item Quantity**

Specifies the number of items purchased.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **iq**    | integer    | 0             | *None*     | item                |

Example usage: `iq=4`

**Item Category**

Specifies the category that the item belongs to.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **iv**    | string     | *None*        | 500 Bytes  | item                |

Example usage: `iv=Blue`

***

#### NPS

This hit is most likely to be sent by the NPS widget eventhough you can build your own NPS tracking and get the result in our NPS reporting.

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("nps", {
  nid: "OD564",     // NPS ID
  ns: 4,            // NPS Score
  nf: "awesome!",   // NPS Feedback
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="info" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "nid": "OD564",
  "ns": 4,
  "nf": "awesome!",
  "t": "NPS",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* An *nps* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`nps`'**

**NPS ID**

The nps ID.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **nid**   | text       | *None*        | 500 Bytes  | nps                 |

Example usage: `nid=OD564`

**NPS Score**

Specifies the nps score.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ns**    | integer    | 0             | *None*     | nps                 |

Example usage: `ns=4`

**NPS Feedback**

The nps Feedback.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **nf**    | text       | *None*        | 500 Bytes  | nps                 |

Example usage: `nf=awesome!`

***

#### Product

This hit is meant to be used with the abandoned cart native targeting criterion.

{% tabs %}
{% tab title="JavaScript" %}

```
window.abtasty.send("product", {
  pit: "CART_ITEM",
  pcid: "CARTPROD0001",
  pq: 5,
  pp: 15.99,
  ps: "ECOMPROD00001",
  pn: "MyProduct"
});
```

{% endtab %}

{% tab title="Shell" %}
{% hint style="warning" %}
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
{% endhint %}

```
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  -d '{
  "pit": "CART_ITEM",
  "pcid": "CARTPROD0001",
  "pq": 5,
  "pp": 15.99,
  "ps": "ECOMPROD00001",
  "pn": "MyProduct",
  "t": "PRODUCT"
}' --output ariane_response.tmp
```

{% endtab %}
{% endtabs %}

**Common arguments**

* An *product* hit **must implement the** [Common arguments](/client-side/data-apis/universal-collect/uc-common-arguments.md)
* Common argument 't' (type) **must be set to '`product`'**

**Product interaction type**

Specifies the type of interaction. Only three values possible: `CART_ITEM`, `CART_TOTAL` or `VIEW`.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pit**   | String     | None          | *None*     | product             |

Example usage: `pit=CART_ITEM`

**Product cart Id**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pcid**  | string     | *None*        | *None*     | product             |

Example usage: `pcid=CARTPROD0001`

**Product quantity**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pq**    | integer    | *None*        | *None*     | product             |

Example usage: `pq=5`

**Product price**

* When `pit=CART_ITEM` you should put the product price.
* When `pit=CART_TOTAL` you should put the total price of the cart.

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **pp**    | float      | *None*        | *None*     | product             |

Example usage: `pp=15.99`

**Product SKU**

| Parameter | Value Type | Default Value | Max Length | Supported hit types |
| --------- | ---------- | ------------- | ---------- | ------------------- |
| **ps**    | String     | *None*        | 100 Bytes  | product             |

Example usage: `ps=ECOMPROD00001`

**Product name**

| Parameter | Value Type | Default Value | Max Length     | Supported hit types |
| --------- | ---------- | ------------- | -------------- | ------------------- |
| **pn**    | String     | *None*        | 100 characters | product             |


---

# 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.abtasty.com/client-side/data-apis/universal-collect/uc-hits.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.
