Abandoned basket campaigns are when you send emails to recipients who recently added products to their baskets without completing the purchase. The email shows the content of the abandoned basket, along with a link to access the basket on your website.
The following is an example of how an Abandoned Basket Campaign can be set up. Your specific setup may differ from this example, but there will be a lot of useful points that can be used to succeed with your campaign.
- How to Set Up the Abandoned Basket Data Structure
- How to Set Up the Trigger
- How to Set Up the Abandoned Basket Email
- How to Set Up the Abandoned Basket Flow
- How to Trigger the Abandoned Basket Campaign
How to Set Up the Abandoned Basket Data Structure
Be aware that this process requires a technical understanding. You might need to contact a developer to set this up.
To store the data for the Abandon Basket, you must create a One-to-Many Table.
- Create a One-to-Many Table called 'ABANDONED_BASKET'
- Add a string key field called 'ID' to store the ID of a specific product for the basket. This is also used as the identifier since the recipient cannot have the same product in the basket twice.
- Add a number field called 'QUANTITY'. This will show the number of products in the basket.
To store the data for all of the products, you need a 'PRODUCT' Global Data Table.
- Create a Global Data Table called 'PRODUCT'.
- Create a string key field called 'ID'. This will store the product ID and is used when linking the One-to-Many table to the Global Data Table.
- Create a string field called 'NAME'. This will show the name of the product.
- Create a string field called 'IMAGE'. This will show an image of the product.
- Create a number field called 'PRICE'. This will show the price of the product.
Create a Data Lookup to link the ID of the One-to-Many table with the ID of the Global Data Table.
- Create a new 'One-to-Many to Global Data Table' lookup called 'ABANDONED_BASKET_PRODUCT'.
- Select the 'ABANDONED_BASKET' table and the 'ID' field as the One-to-Many field.
- Select the 'PRODUCT' table and the 'ID' field as the Global Data Table.
To store the link to the abandoned basket, you need a Person Data field.
- Create a string Person Data called 'ABANDONED_BASKET_LINK'.
How to Set Up the Trigger
To trigger the abandoned basket Flow, you need to set up an Event.
- Create an Event called 'Abandoned Basket'.
- Enable reset for the Event and set it to reset after '1' number of times.
How to Set Up the Abandoned Basket Email
To show the content of the abandoned basket, you need to create an email with a Data Lookup Block.
- Create a new email called 'Abandoned Basket' and fill out the email's properties.
- Insert a Content Block to show a single product from the abandoned basket.
- Make the Block into a Data Lookup Block and use the 'ABANDONED_BASKET_LINK' Data Lookup.
- Set the Lookup Block to show the number of max entries. This is based on the expected maximum number of different products in the abandoned basket. A maximum of 100 entries can be shown.
- Insert the following Data Lookup fields directly as shown values:
- QUANTITY
- NAME
- PRICE
- Insert the following HTML to show the product Image:
<img src="<persondata>ABANDONED_BASKET_PRODUCT.IMAGE</persondata>" style="display:block;" width="100%" alt="image">
- Insert a call to action Block with a block and add the following URL as an external link:
https://{ABANDONED_BASKET_LINK}
- Save the email.
How to Set Up the Abandoned Basket Flow
To send the abandoned basket email, you also need to set up a triggered flow.
- Create a Flow.
- Add a trigger to the Flow.
- Use the Event 'Abandoned Basket' and set it to 1.
- Add an email Step.
- Add the 'Abandoned Basket' email to the Email Step.
- Save the Flow.
How to Trigger the Abandoned Basket Campaign
To trigger the abandoned basket campaign, a series of API calls must be made in the following order. You can learn more about our API calls in the Agillic developers portal.
The following example uses the recipient ID of red@sweetmail.com, and API examples are written as cURL commands.
A call to clear out the previously abandoned basket in the 'ABANDONED_BASKET' One-to-Many table
curl -X POST \
https://api-eu1.agillic.net/recipients/red@sweetmail.com/oneToManyTables/ABANDONED_BASKET/:truncateTable \
-H 'Authorization: Bearer *****************************' \
-H 'Content-Type: application/json' \
-H 'charset: utf-8'
A call to add the Person Data 'ABANDON_BASKET_LINK'
curl -X PUT \ https://api-eu1.agillic.net/recipients/red@sweetmail.com \ -H 'Authorization: Bearer *****************************' \
-H 'Content-Type: application/json' \
-H 'charset: utf-8' -d '{ "personData": { "ABANDONED_BASKET_LINK": "agilliccandy.com/mybasket?basketID=12345678"} }'
A call to add the new abandoned basket to the 'ABANDON_BASKET' One-to-Many table
curl -X POST \ https://api-eu1.agillic.net/recipients/red@sweetmail.com/oneToManyTables/ABANDONED_BASKET/:batchUpdateRecords \ -H 'Authorization: Bearer *****************************' \
-H 'Content-Type: application/json' \
-H 'charset: utf-8' -d '[ {"ID" : "123", "QUANTITY" : "1" }, {"ID" : "4321", "QUANTITY" : "2" }, {"ID" : "4221", "QUANTITY" : "1" } ]'
A call to achieve the 'Abandon Basket' Event, which will trigger the send out
curl -X POST \ 'https://api-eu1.agillic.net/recipients/red@sweetmail.com/:achieveEvent?eventId=Abandoned Basket' \ -H 'Authorization: Bearer *****************************' \
-H 'Content-Type: application/json' \
-H 'charset: utf-8'
The 'PRODUCT' Global Data Table should also be kept up to date with new products. However, you can synchronise the table as new products are added, and not when a specific recipient has a new abandoned basket.