Loading...
Area: Episerver Perform, Episerver Reach

Link to a specific basket

This document shows how to set up abandoned basket trigger campaigns to link to a particular basket with the abandoned products.

Note: In Episerver Commerce, a basket is also known as a shopping cart.

There are 3 main areas to consider:

  • Changes to basket page tracking.
  • Steps for the Email Service Provider (ESP).
  • Populating the basket with abandoned products.

Basket page tracking

To restore a basket for a session, you need to pass a basketId value in the Episerver tracking variable. The basketId should be unique for a user’s session on your site and must relate back to a basket state stored on the your side.

To extend the basket page tracking to track the basketId, include a string value in the tracking variable. For example:

{
  "type"     : "basket",
  "lang"     : "en-gb",
  "basket"   : {
                 "items"    : [{
                                 "refCode" : "PROD500",
                                 "qty"     : 2,
                                 "price"   : 25.5
                               }, 
                               {
                                 "refCode" : "PROD600",
                                 "qty"     : 4,
                                 "price"   : 12.0
                              }],
                 "currency" : "GBP",
                 "basketId" : "Basket123"
               }
}

Episerver then associates the basketId with that session and can be passed to the ESP if the session satisfies the rules set up for the trigger campaign.

Steps for the Email Service Provider (ESP)

For the ESP to receive the basketId during the trigger process, you will need to notify Episerver with your intention to use this feature, so it can be enabled for your ESP’s integration with our service.

Once the ESP is set up to accept the basketId variable through Episerver, the ESP will need to catch the basketId variable that is passed as part of the trigger and use this to create a link to the basket page on your site.

Adestra ESP

For example, the email campaign template includes a button to complete an order, which has a link to the basket on the client site: https://www.my-site.com/cart?episerverBasketId=[*transaction.peeriusBasketId*]

Adestra ESP replaces the placeholder ‘[*transaction.peeriusBasketId*]’ with the basketId value sent as part of the trigger when sending out the email.

Episerver Campaign ESP

Note: To add a new standard field called externalbasketid to Reach-related recipient lists, contact customer support. 

For example, the email campaign template includes a button to complete an order, which has a link to the basket on the client site: https://www.my-site.com/cart?episerverBasketId={externalbasketid}

Episerver Campaign ESP replaces the placeholder ‘{externalbasketid}’ with the basketId value sent as part of the trigger when sending out the email.

Populating the basket with abandoned products

When the user clicks on the link to view their abandoned basket, check the basketId parameter passed with the request and pull the last-known products from your side for that basketId, because Episerver does not send the abandoned products as part of the trigger.

This process is unique to the setup of your site but you should have the functionality to pull the last-known basketed products for the basketId and add these to the current basket for that user.

It is important that the products match those that the user abandoned.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Oct 19, 2018