Order Interaction
An Order interaction is an ecommerce event used to capture actions related to new, in progress, or completed orders. This is the standard interaction data model for reporting purchases, returns, cancellations, and other order lifecycle events.
The order object defines the details of the transaction, while interaction.name defines the action being taken.
| Field Name | Field Type | Description |
|---|---|---|
name | string | Required. The type of order interaction that occurred. Use the standard SDK constants for this field. For example, Purchase, Return, and so on. |
order.id | string | Required. A unique identifier representing the order. |
order.totalValue | number | Required. The total value of the order. |
order.lineItems | Line Item Data | An array of Line Item Data values. |
order.currency | string | The currency of the order. |
order.attributes | object | A user-supplied value. |
Here's the structure of an order interaction with the minimum required fields, lineItems, and optional attributes.
Always use the built-in constants for the interaction.name field to ensure consistency across your instrumentation.
| Name | Value |
|---|---|
SalesforceInteractions.OrderInteractionName.Purchase | Purchase |
SalesforceInteractions.OrderInteractionName.Return | Return |
SalesforceInteractions.OrderInteractionName.Cancel | Cancel |
SalesforceInteractions.OrderInteractionName.Preorder | Preorder |
SalesforceInteractions.OrderInteractionName.Exchange | Exchange |
SalesforceInteractions.OrderInteractionName.Ship | Ship |
SalesforceInteractions.OrderInteractionName.Deliver | Deliver |
This example shows how to capture a purchase interaction, typically fired once on the order confirmation page.
Here's how to use the sitemap to automatically fire a purchase event.
See Also