---
title: Track transactions - Capacitor
description: Track transactions with the Contentsquare SDKs and Capacitor
lastUpdated: 08 August 2025
source_url:
  html: https://docs.contentsquare.com/fr/capacitor/6-3-0/track-transactions/
  md: https://docs.contentsquare.com/fr/capacitor/6-3-0/track-transactions/index.md
---

Note

Cette page est affichée en anglais car elle n'est pas disponible dans votre langue.

To associate a user’s session with their potential purchases (and corresponding revenue), you must send the transaction via a dedicated API. For each transaction, we send:

* Price (`number`, mandatory)
* Currency (`CurrencyCode` or `string`, mandatory)
* Transaction ID (`string`, optional)

The plugin defines a `TransactionItem` type to prevent potential typing errors.

```javascript
import { ContentsquarePlugin, CurrencyCode, TransactionItem } from '@contentsquare/capacitor-plugin';


const myTransaction: TransactionItem = {
      transactionValue: 10,
      transactionCurrency: CurrencyCode.USD,
      transactionId: 'my_transaction_id',
};
ContentsquarePlugin.sendTransaction(myTransaction)
      .catch(err => {
        // Handle Error
      });
```

Attention

**Each transaction must only be sent once**. A common mistake is to trigger the sending when the confirmation screen is displayed. This leads to triggering the transaction each time the user puts the app in background and then in foreground on the confirmation screen.

## Currency

The currency is conforming to the [ISO 4217 ↗](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes) standard. Although the currency can be passed as “alphanumeric code”, you should always prefer using the plugin’s CurrencyCode object values. If you have to pass the ISO code as a string, note that capitalization is not a factor (`"USD"`, `"Usd"` or `"usd"` will all be treated as the US Dollar).

If the currency passed doesn’t match our supported currencies, the SDK will send a currency value of “-1”. It will be processed as the default currency of the project.
