# Purchase events

The **sale event** is a key element for measuring the performance of advertising campaigns. Installed on the order confirmation page, it collects key data about completed transactions, such as the order amount and purchased products. This information allows precise attribution of sales to the campaigns that led to these conversions.

To send the sale event, you need to execute the following code on the order confirmation page:

{% tabs %}
{% tab title="MINIMAL EXAMPLE" %}

```javascript
<script type="text/javascript">
  window.vzbl_q = window.vzbl_q || [];
  window.vzbl_q.push({
    event: "purchase",
    value: {
      purchase_id: "CMD_NUMBER",
      currency: "EUR",
      items: [{
        product_id: "sku910d",
        brand: "FAMOUS BRAND",
        price: 456.90,
        quantity: 2
      }]
    }
  });
</script>
```

{% endtab %}

{% tab title="MARKETPLACE EXAMPLE" %}

```javascript
<script type="text/javascript">
  window.vzbl_q = window.vzbl_q || [];
  window.vzbl_q.push({
    event: "purchase",
    value: {
      purchase_id: "CMD_NUMBER",
      currency: "EUR",
      items: [{
        product_id: "sku910d",
        brand: "FAMOUS BRAND",
        price: 456.90,
        quantity: 2,
        offer_id: "off1a7z26ue",
        seller_id: "2ac661"
      }]
    }
  });
</script>
```

{% endtab %}

{% tab title="FULL EXAMPLE" %}

```javascript
<script type="text/javascript">
  window.vzbl_q = window.vzbl_q || [];
  window.vzbl_q.push({
    event: "purchase",
    value: {
      purchase_id: "CMD_NUMBER",
      currency: "EUR",
      alias: "233eca12ac66bd99b410dae07ca910d9",
      items: [{
        product_id: "sku910d",
        brand: "FAMOUS BRAND",
        price: 456.90,
        quantity: 2,
        offer_id: "off1a7z26ue",
        seller_id: "2ac661",
        seller: "ACME"
      }]
    }
  });
</script>
```

{% endtab %}
{% endtabs %}

| Parameters            | Description                                                             | Mandatory         |
| --------------------- | ----------------------------------------------------------------------- | ----------------- |
| purchase\_id          | The order number displayed on the order confirmation page               | **YES**           |
| alias                 | The customer identifier transformed with a hash function (MD5, SHA-256) | NO                |
| currency              | The currency's ISO code                                                 | **YES**           |
| items\[i].product\_id | Unique identifier of the PO line product                                | **YES**           |
| items\[i].price       | The purchase price of the product from the order line                   | **YES**           |
| items\[i].quantity    | The quantity of the product from the order line                         | **YES**           |
| items\[i].offer\_id   | The unique identifier of the ordered offer                              | YES (marketplace) |
| items\[i].seller\_id  | The merchant identifier of the product from the order line              | YES (marketplace) |
| items\[i].seller      | The merchant name of the product from the order line                    | NO (marketplace)  |
| items\[i].brand       | The product brand of the command line                                   | NO                |


---

# 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.veasybl.io/en/purchase-events.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.
