For the back-end purchase event you should use the Spotler Activate API when a purchase is confirmed in the order system.
➡️ API Docs: Back-end tracking
Because of the following situations, both frontend and backend purchase are recommended:
- The frontend purchase is not always triggered because the thank you page is not loaded
- Because of some Adblockers the cookies are not accepted and therefore no frontend events are sent to Spotler Activate
In the example below the advantage of sending both is shown:
Frontend purchase only |
Frontend & Backend purchase |
---|---|
|
|
The purchases will be merged based on order ID.
Fields
In the backend purchase event, the following fields will be sent as a minimum:
Field label | Field content | |
---|---|---|
event | Purchase | |
Email address of the profile | ||
orderid | Id of the order | |
products | id | Id of the purchased product |
quantity | Number of the purchased product |
Note: the product id in the event should match the SKU of the product in Spotler Activate!
In the following circumstances more fields are required:
- Are multiple languages used? → Then also send language into the product array
- Are multiple currencies used? → add currency to the event
In this event extra data fields from the database can be sent, for this please use custom data fields.
Create a audience to check the event
You can check the event in Spotler Activate as follows:
- Go to Audiences and create a new audience
- Click on custom
- Set the following rules:
- Events = purchase
- Name = Test backend purchase
- Retention = 1
- Save the audience and wait until the status is live. Click on Inspect:
- Click on an event ID. Check the following fields in the event:
- Created at: is this a time after the implementation of the API Call? If not select another event ID.
- Api inserted & api verified: does one of these fields contain 'yes'? Then the event has been implemented correctly. If not, check the implementation.
Please note that the frontend and backend purchase are merged based on the order id. When you only send a backend purchase the consent fields are not visible in the event. A change of consent can be checked in the profile of the event.