---
title: Track transactions - iOS (classic)
description: Track transactions with the Contentsquare iOS SDK
lastUpdated: 11 March 2026
source_url:
  html: https://docs.contentsquare.com/en/ios/track-transactions/
  md: https://docs.contentsquare.com/en/ios/track-transactions/index.md
---

> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.

The latest CSQ SDK is here! Learn how to [upgrade your app](https://docs.contentsquare.com/en/csq-sdk-ios/experience-analytics/upgrade-from-cs-sdk/).

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)

- Swift

  ```swift
  // numeric currency
  // CustomerTransaction(id: String?, value: Float, currency: Currency)
  let transaction = CustomerTransaction(id: "transaction_id", value: 430.99, currency: Currency.eur)
  Contentsquare.send(transaction: transaction)


  // alphanumeric currency
  // CustomerTransaction(id: String?, value: Float, currency: String)
  let transaction = CustomerTransaction(id: "transaction_id", value: 430.99, currency: "EUR")
  Contentsquare.send(transaction: transaction)
  ```

- Objective-C

  ```objective-c
  // numeric currency
  CustomerTransaction *transaction = [[CustomerTransaction alloc] initWithId:@"transaction_id"
                                                                      value:430.99
                                                                    currency:CurrencyEur];
  [Contentsquare sendWithTransaction:transaction];


  // alphanumeric currency
  CustomerTransaction *transaction = [[CustomerTransaction alloc] initWithId:@"transaction_id"
                                                                      value:430.99
                                                              stringCurrency:"EUR"];
  [Contentsquare sendWithTransaction: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 is conforming to the [ISO 4217 ↗](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes) standard. The currency can be passed either as "alphanumeric code" or "numeric code".

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