Transactions are a special type of event, used to track when a user has purchased something from you. The data is reported in the Ecommerce dashboard and in the People.
Transactions can be tracked either in the browser using the JavaScript Tracker when a user completes a purchase, or on the backend using the backend tracking modules when your application processes the transaction.
Each transaction requires an ID, which must be unique to that transaction.
Note: it is not possible to remove test transactions from your Ecommerce dashboard. Therefore we highly recommend creating a test project in your GoSquared account before you start sending data to your production project.
| Name | Description | Type | Default |
|---|---|---|---|
| Transaction ID | The unique identifier for the transaction | String/Number | undefined |
| Transaction Options | Options for the transaction | Object | {} |
| Items | A list of items/products that have been purchased in this transaction | Array of Objects | [] |
By default, GoSquared calculates the total revenue and quantity amount from the items in the transaction. You may want to override this in some cases, such as when a discount was applied.
This is possible by specifying revenue and quantity totals in the transaction options.
| Key | Description | Type | Default |
|---|---|---|---|
revenue |
The total revenue from this transaction | String/Number | Sum of revenue from items (or 0) |
quantity |
The total number of items ordered | Number | Sum of the quantity from items (or 0) |
| Key | Description | Type | Default |
|---|---|---|---|
name |
The name of the item/product | String | undefined |
category / categories |
The category (String) or categories (Array) the item belongs to | String/Array | undefined |
revenue |
The total revenue from this item | String/Number | 0 (or price x quantity) |
quantity |
The total number of this item ordered | Number | 1 |
price |
The price per item | String/Number | 0 |