Xem thêm

Recovering Abandoned Carts: How to Boost Sales with BigCommerce

Complete your purchase email BigCommerce offers a powerful cart recovery system to help merchants recover lost business by effectively converting abandoned carts into orders. With the built-in Abandoned Cart Saver tool, merchants can automate email...

Complete your purchase email Complete your purchase email

BigCommerce offers a powerful cart recovery system to help merchants recover lost business by effectively converting abandoned carts into orders. With the built-in Abandoned Cart Saver tool, merchants can automate email campaigns to encourage customers to complete transactions after leaving items in their cart. In this article, we will explore how headless storefronts can leverage the Abandoned Cart Saver and BigCommerce's APIs to recover abandoned carts.

Abandoned Cart Saver: Turning Lost Opportunities into Sales

BigCommerce defines a cart as abandoned when a shopper leaves the cart without attempting payment and the cart has been inactive for one hour. The Abandoned Cart Saver emails contain a link that redirects shoppers back to the cart page where they can complete their order.

Abandoned cart emails Abandoned cart emails

Enabling the Abandoned Cart Saver notifications on your store is simple. Go to Settings > General > Miscellaneous in an active MSF-enabled control panel. Then, visit Marketing > Abandoned Cart Emails to access your Abandoned Cart Emails settings. By setting up these notifications, you can seamlessly recover lost sales from abandoned carts.

Triggering Abandoned Cart Saver Notifications

The Abandoned Cart Saver will trigger in the following circumstances:

  • For Stencil stores: A logged-in customer adds an item to the cart, then leaves the store without attempting payment.
  • For stores using Optimized One-Page Checkout: A guest customer adds an item to the cart, begins the checkout process by entering their email address, then leaves the store without attempting payment.
  • For headless stores using custom checkout solutions:
    • A logged-in customer with the accepts_product_review_abandoned_cart_email property set to true creates a cart and then leaves the store without attempting payment.
    • A guest customer creates a cart and adds their email address to the cart, then leaves the store without attempting payment.

Setting up the Abandoned Cart Route

By default, the Abandoned Cart Saver email link points to the Stencil storefront (channel ID 1). To direct the Abandoned Cart Saver email link to your headless storefront, you need to set up a recover_abandoned_cart site route.

To accomplish this, you will require a channel site ID. If you don't know your channel site ID, you can retrieve it by sending a GET request to the Get a Channel Site endpoint. You can also find your channel ID by navigating to Channel Manager > Storefronts in the control panel, clicking on ... next to your headless storefront, and selecting Edit settings from the dropdown. Additionally, you can send a GET request to the Get All Channels endpoint.

To create a recover_abandoned_cart site route, simply send a POST request to the Create a Site Route endpoint. You can then test the route creation by sending a GET request to the Get a Site's Routes endpoint. The response will contain all the routes associated with your headless storefront's domain.

Leveraging the Abandoned Carts API

The Abandoned Cart Saver email link includes a token, the t parameter, that you can use to call the Abandoned Carts API and obtain the corresponding cart ID. With the cart ID, a headless storefront can request the cart details from the Carts API.

Example of an Abandoned Cart Saver email link:

http://commerce-zr8y-teststore-bigcommerce.vercel.app/my-abandoned-cart-page/?t=305c6c15f6f0a3c0929770a538cf1ff7

To retrieve the abandoned cart ID, send a GET request to the Get an Abandoned Cart endpoint. The response will contain the corresponding cart ID. You can then use this cart ID to retrieve the cart details by sending a GET request to the Get a Cart endpoint.

Implementing Cart Recovery on Headless Storefronts

To trigger the abandoned cart recovery sequence, the cart must be associated with a channel ID and be aware of the shopper's email address. Headless storefronts using custom checkout solutions can leverage BigCommerce's Customers and Carts APIs to initiate the abandoned cart recovery sequence.

The following example demonstrates how a headless storefront can recover abandoned cart details without relying on Optimized One-Page Checkout:

  1. Link your headless storefront to your sales channel by sending a POST request to the Create a Site endpoint.
  2. Use the Site Routes endpoint to create a recover_abandoned_cart route.

Create Cart with Customer

  1. To create a customer, send a POST request to the Create Customers endpoint. In the request body, set accepts_product_review_abandoned_cart_emails to true to enable Abandoned Cart Saver notifications. This will create a customer account optimized to receive Abandoned Cart Saver emails.
  2. Send a POST request to the Create a Cart endpoint to create a cart. Include the customer ID and channel ID in the request body to ensure that the URL inserted in transactional emails contains the correct site and routes.

Create Cart with Guest Customer

  1. Send a POST request to the Create a Cart endpoint to create a cart.
  2. Send a POST request to the Add Checkout Billing Address endpoint to add the checkout billing address. Include the email address in the request body to trigger the abandoned cart saver notification.

By following these steps, you can create a cart associated with the headless storefront without relying on BigCommerce's Optimized One-Page Checkout. As the checkout process remains incomplete, the store will treat this cart as abandoned and initiate the abandoned cart recovery sequence.

Resources

For further information, check out these BigCommerce resources:

1