---
title: Track transactions - Android
description: Track transactions with the Contentsquare Android SDK
lastUpdated: 01 December 2025
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-android/experience-analytics/track-transactions/
  md: https://docs.contentsquare.com/en/csq-sdk-android/experience-analytics/track-transactions/index.md
---

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 (mandatory)
* Currency (mandatory)
* Transaction ID (optional)

- Kotlin

  ```kotlin
  import com.contentsquare.api.model.Transaction
  import com.contentsquare.api.contract.Currency


  val transaction = Transaction(430.99f, Currency.EUR, "my_id")
  CSQ.trackTransaction(transaction)
  ```

- Java

  ```java
  import com.contentsquare.api.model.Transaction;
  import com.contentsquare.api.contract.Currency;


  Transaction transaction = new Transaction(430.99f, Currency.EUR,  "my_id");
  CSQ.trackTransaction(transaction);
  ```

Warning

**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` enum provides a list of all supported currencies, conforming to the [ISO 4217 ↗](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes) standard.

* Kotlin

  ```kotlin
  import com.contentsquare.api.contract.Currency


  val currency = Currency.USD
  val currencyFromString = Currency.fromString("USD")
  val currencyFromInteger = Currency.fromInteger(840)


  // string or integer ISO code can also be retrieved from the enum value
  Currency.USD.stringCode // "USD"
  ```

* Java

  ```java
  import com.contentsquare.api.contract.Currency;


  Currency currency = Currency.USD;
  Currency currencyFromString = Currency.fromString("USD");
  Currency currencyFromInteger = Currency.fromInteger(840);


  // string or integer ISO code can also be retrieved from the enum value
  Currency.USD.stringCode // "USD"
  Currency.USD.integerCode // 840
  ```

Note

If the currency passed for conversion doesn't match a supported currencies, the SDK will send a currency value of `-1`. It will be processed as the default currency of the project.

## Float precision

The `Transaction` API uses a `Float` to represent the transaction value, which means very large numbers may be **rounded** when stored or serialized.

For example, `1234567890f` becomes `1234567936f`.

This behavior is normal for floating-point values and does not affect regular currency amounts (`0.99`, `430.00`, `100000.00`).
