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:
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 /wiki/spaces/SG/pages/1272807432, which are needed to set up use cases
Implementation
The documentation for implementing the Backend Purchase via API Calls, can be found here: https://squeezely.tech/documentation#backend-purchase
Check
After the implementation you can check the following two things
The response to the API call
The event in Squeezely
The following response to the API call is correct:
The following response is incorrect:
You can check the event in Squeezely as follows:
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