Track transactions

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)
window._uxa = window._uxa || [];
id: "123" /* Transaction ID (string, up to 40 chararacters) */,
"9.99" /* Transaction's total cost (integer or string, up to 12 digits and 2 decimals - extra decimals are truncated) */,
"usd" /* optional - Currency value (string, numeric or alphanumeric ISO 4217 value) */,
// value is a float
// currency is a string that must be inferior to 10 characters
// id is a string or null

The currency is conforming to the ISO 4217 standard.
The currency must be passed as an “alphanumeric code”.

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