Track transactions

A newer version of this documentation is available. Swtich to the latest version docs.

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 (double, required)
  • currency (String, required)
  • transactionId (String, optional)
await contentsquare.sendTransaction(430, 'EUR', "testId");

You can also use the Currency helper to get the list of ISO 4217 currencies.

await contentsquare.sendTransaction(430, Currency.EUR.toStr());

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.