Transactions are special types of events which are inferred from existing events. Blueshift stores a transaction event per transaction ID and any attributes from the new event are appended to the transaction event. Blueshift also stores the most recent state (transaction_state) of your transaction. For example, purchased, cancelled, and so on.
Consider the following points about transactions and transaction models:
- Before you can define a transaction identifier and link transaction states (events), these events must be added in Blueshift.
- A transaction identifier must be present as an attribute in all transaction events so that they can be linked to the appropriate transaction model.
- The transaction model must be defined before any events can be linked to a transaction record. Existing events are not automatically added to a transaction.
- There might be a delay between an event between an event occurring and the linking of the event to a transaction record. Once an event is linked to a transaction record, you can see the event in the transaction history and under the Transactions tab in the Customer profile.
The following diagram shows the steps involved in setting up transaction models.
To view Transaction models that are already set up in Blueshift, go to Customer Data > Transactions in the left navigation.
Use the actions menu to View or Edit a Transaction model.
Note: Before you can define a transaction identifier and link transaction states (events), these events must be added in Blueshift.
To add a transaction model, complete the following steps:
- Go to Customer Data > Transactions in the left navigation.
- Click +Transaction on the Transactions index page.
- Specify a transaction Identifier. The identifier links all the related events in your transactions and must be unique. You can specify more than one identifier for the transaction model.
For example, for a hotel booking the transaction identifier can be booking_id but for a sales cycle the identifiers can be lead_id and opportunity_id.
- Add related States (Events) for the transaction.
For example, for a hotel booking, the States can be booked, canceled, checked_in, checked_out, and so on.
Note: If you specify more than one identifier for the transaction model, all identifiers for that particular transaction model must be present as attributes in the event data sent to Blueshift.
- Add any Additional Details.
- Click Save.
- You cannot edit a transaction identifier if an event has been published for the identifier.
- States that are linked to an identifier and have been published cannot be removed.
- You can remove states that have not been published.
- You can add more states for the identifier.
Click on the row for a transaction model on the index page or use the actions menu to view all the events associated with a transaction model.
- These are the events for which all the identifiers for that particular transaction model are present as attributes.
- For all transactions, the current state of the transaction is displayed.
For example, when a customer books a hotel room, a transaction event booked occurs where the identifier is hotel_booking = 101. You can view transaction 101 in transaction history and the State is displayed as booked.
- When an event occurs that changes the state of a transaction, the transaction is updated with the state.
For example, when the same customer checks into the hotel, a transaction event checkin occurs where the identifier is hotel_booking = 101. The transaction hotel_booking = 101, is updated with the event checkin. You can view transaction 101 in transaction history and the State is displayed as checkin.
- Click any transaction to view details.
- Previous states for a transaction are displayed in the details.
- You can also view details in JSON format.