The purchase event should be sent to the API endpoint of Squeezely when a purchase is confirmed in the order system. It is also recommended to trigger the purchase from the frontend as well.
When using Copernica, the backend purchase can be received through the link of:
Expand | ||||
---|---|---|---|---|
| ||||
Because of the following situations, both frontend and backend purchase are recommended:
In the example below the advantage of sending both is shown:
|
Content
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 | ||
Id of the order | ||
Id of the purchased product | ||
Number of the purchased product |
Note: the product id in the event should match the SKU of the product in Squeezely!
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
Extra
In this event extra data fields from the database can be sent. Maybe there are fields added to the event in the Data Plan /wiki/spaces/SG/pages/1272807432, which are needed to set up use cases
Expand | ||
---|---|---|
| ||
An overview of the data fields you can send in the event, can be found here: Data fields |
Expand | ||
---|---|---|
| ||
First you need to create the custom data fields in Squeezely Creating custom data fields Next you can send these with the field label: custom_(name of the field). For example, in the case of the custom data field custom_province, custom_province must be sent along. |
...
The following response is incorrect:
...
Expand | ||
---|---|---|
| ||
|
...
Go to: https: //squeezely.tech/data/audience/new
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
Go to Audiences
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.
More information about the backend purchase can be found here: https://squeezely.tech/documentation#backend-purchase
...