Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

Bookerz

Expand
titleWhy is both frontend and backend tracking recommended for the purchase event?

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 Squeezely

In the example below the advantage of sending both is shown:

Frontend purchase only

Frontend & Backend purchase

  1. Profile A does a purchase

  2. Profile A clicks away the thank you page before it is loaded = no frontend purchase, so no purchase

  1. Profile B will make a purchase

  2. Profile B clicks away the thank you page before it loads = no frontend purchase

  3. Information from the order system that Profile B has made a purchase = backend purchase


Content

In the backend purchase event, the following fields will be sent as a minimum:

Field label

Field content

event

Purchase

email

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 Squeezely!

In the following circumstances more fields are required:

  1. Are multiple languages used? → Then also send language into the product array

  2. 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
titleWhich data fields can I include in the event?

An overview of the data fields you can send in the event, can be found here: Data fields


Expand
titleHow can I send custom data fields along with the event?

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
titleWhat should I do if the response is incorrect?

...

  • 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

...