Automated Abandoned Cart

Did you know you can automatically reach out to customers with abandoned carts? Use this guide to get automated abandoned cart messaging up and running today with Airship Sequences.

A few timely reminders can provide effective motivation for your customers in revisiting their carts and checking out.

Building an Abandoned Cart

To get started, we need to be able to trigger on user behaviors. For abandoned cart messaging, the user will enter the sequence when they add an item to their cart, and exit once they purchase. Setting up events to send to Airship can be done in the Android or iOS SDK with the following calls.

Add Retail Events

 Note

If you use an integration, or your application is already instrumented with custom events, you may need to adjust the event names for purchased and added_to_cart.

To enter the user into the Sequence, instrument the application with an event when an item is added to the cart. Use the following templates to create added_to_cart and purchased events:

Android example
fun onAddToCart(identifier: String, description: String?) {
    RetailEventTemplate.newAddedToCartTemplate()
            .setId(identifier)
            .setDescription(description)
            .createEvent()
            .track()
}

iOS example
func onAddToCart(_ identifier: String, description: String?) {
    let template = RetailEventTemplate.addedToCartTemplate()
    template.identifier = identifier
    template.eventDescription = description
    template.createEvent().track()
}

Next, add an event when the cart is purchased:

Android example
fun onPurchase() {
    RetailEventTemplate.newPurchasedTemplate()
            .createEvent()
            .track()
}

iOS example
func onPurchase() {
    let template = RetailEventTemplate.purchasedTemplate()
    template.createEvent().track()
}

Now that your app is set up to send the necessary events, it’s time to create your sequence.

Create the Sequence

Click   at the top of your project’s dashboard, select Sequence, then click Start from scratch. Name the sequence Abandoned Cart, then use added_to_cart for the Custom Event trigger, and use purchased event as the Conversion goal.

Next, choose the delivery time for the first message. In this example, the first message will be delivered 1 day after the most recent added_to_cart event has occurred.

Next, we can define the message that will be delivered. In this case, the message is a push notification letting the customer know that they have items remaining in their cart.

Once setup is complete, the sequence is ready for testing and can be started. We recommend using the Test Run feature to ensure the messages are built correctly as they are delivered to your test devices.