> ## Documentation Index
> Fetch the complete documentation index at: https://docs.depict.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Purchase tracking

> To calculate revenue figures, you need to track purchases. This is done with the `purchase` event.

<Warning>
  This page does not apply to installs made in 2025 or later of the Depict Shopify apps
</Warning>

A purchase is an event that tracks when a user has gone through the checkout process and paid for a set of products. The `transaction_id` should be whatever you use to identify the purchase in your system. The `item_id` in the `items` array should be the SKU of the product. The `price` should be the final price of the product, after any taxes, discounts, etc have been applied.

Depict will automatically calculate what percentage of the purchases were made due to clicking on Depict product links, so you should send events for all purchases to Depict. In other words, even purchase events not coming from Depict.

<CodeGroup>
  ```typescript dpq theme={null}
  dpq("purchase", {
      transaction_id: "YOUR_TRANSACTION_ID",
      items: [{ item_id: "white-socks-xl", price: 89.9, quantity: 12 }],
      currency: "SEK",
  });
  ```

  ```typescript DPC instance theme={null}
  dpc.sendPurchaseEvent({
      transaction_id: "YOUR_TRANSACTION_ID",
      items: [{ item_id: "white-socks-xl", price: 89.9, quantity: 12 }],
      currency: "SEK",
  });
  ```
</CodeGroup>
