1. Home
  2. Cookbook
  3. Campaigns
  4. Cart reactivation email campaign

Cart reactivation email campaign

Cart reactivation can be very useful to improve your conversion rate. This campaign automatically sends an email to customers who have left without ordering items they left in their cart.

Thanks to Exponea, you can create and execute this campaign today. Leverage features like including items abandoned in the cart, product recommendations or vouchers. Moreover, you can set up A/B tests and measure the effectiveness of the campaign in improving your revenue.

This guide shows you how to create a cart reactivation campaign from scratch. However, you don’t need to! Contact us on Intercom or speak to your dedicated consultant. We will share with you all the resources and templates necessary to create a cart abandonment campaign.

In order to create a cart reactivation campaign, you need three prerequisites:
1.) Tracking of a cart_update event
2.) Imported catalogue of your products
3.) Customer aggregate containing items customers left in their cart

Start tracking the ‘cart_update’ event

In order to execute this campaign, you need to track an event triggered by every change in customer’s cart. You can implement this tracking through our Exponea Tag Manager, Google Tag Manager, or directly in your code. Below is a sample tracking code.

  • cart_update (add)
exponea.track("cart_update", {
     action: "add",
     item_ids: [{"item_id":"item_id_here","quantity":item_quantity_here},{"item_id":"item_id_here","quantity":item_quantity_here}],
     item_id: "added_item_id_here",
     total_value: total_value_of_cart
});
  • cart_update (remove)
exponea.track("cart_update", { 
     action: "remove", 
     item_ids: [{"item_id":"item_id_here","quantity":item_quantity_here},{"item_id":"item_id_here","quantity":item_quantity_here}],
     item_id: "removed_item_id_here",
     total_value: total_value_of_cart
});

The tracked event will look something like this in Exponea. You can also track different attributes of events, but the aforementioned attributes ‘action’ and ‘item_ids’ are mandatory for correct functioning. If you need help with setting up the correct format of item_ids as list attribute, have a look here.

 

 

Import catalogue of your products

You need to have a catalogue of your products identifiable by their id, which is the same one that is collected in your cart_update event. You can read more about catalogues on this page.

Create a customer aggregate containing items customers left in their cart

After you have implemented cart_update tracking, you can create a customer aggregate, which will show a list of items each customer had in their cart when they last updated its contents. To create a customer aggregate, go to Data & Assets -> Data Manager -> Aggregates -> + Create new. The customer aggregate should follow this format: last cart_update products. You can see a screenshot below.

 

 

The next step in the process is to create the cart reactivation email itself. It is up to you whether you choose to create it in our visual or HTML editors. If you decide to use our visual editor, you must enter the sample code we provide below to include cart products or recommendations as an HTML block.

Create cart reactivation email

In order to create a cart reactivation email, go to Data & Assets -> Asset manager -> and choose whether you want to create a new template using either the visual or HTML builder.

The below code will allow you to include cart items into the cart reactivation email. Please watch closely the comments that explain how the code works and what needs to be altered on your side. You also need to decide which item attributes you want to display. You can display each attribute that is available as a column in your catalogue, simply by calling item.column_name.

{% set items = aggregates['59cb9e784d539b3094f331ed'] %} <!-- this line loads the list of items from the customer aggregate that you created into variable items -->
{% for product in items %}  <!-- this line loops through each product in the items variable, this is necessary to diplay each product customer has left in their cart -->
{% set item = catalogs.cart_products.item_by_id(product.item_id) %} <!-- this line sets variable item, which contains all the product information from the catalogue. As you can see, it matches the item_id from tracking (product.item_id) with the information from the catalogue. In order for this to work, you need to change "cart_products" with the name of the catalogue you want to use to match items from tracking. -->
{% if item %}
<tr> 
  <td class="section"> 
    <table class="product" width="100%"> 
      <tr> 
        <td> 
          <a href="{{ item.item_url }}"><img src="{{ item.image_url }}" alt="{{ item.item_name }}"/></a> 
        </td> 
        <td>
          <a href="{{ item.item_url }}">{{ item.item_name }}</a>
          <span>Quantity: {{ product.quantity }}</span>                      
          <span>Price:{{ (item.price * product.quantity)}}</span>
        </td> 
      </tr> 
    </table>
  </td> 
</tr> 
{% endif %}
{% endfor %}

The code below calculates the total price of the cart. If this information is available in your tracking, you can instead just use a simple jinja “{{event.total_price}}”.

{% for product in items %}
{% set item = catalogs.cart_products.item_by_id(product.item_id) %} <!-- remember you need to change the catalogue name here as well -->
{% set cartprice = (cartprice + (item.price * product.quantity)) %}
{% if loop.index == (items | length) %} 
{% if cartprice > 0%} <span>Total price: {{ cartprice }}</span>
{% endif %} {% endif %}{% endfor %}

This code allows you to enter product recommendations into this email.

{% set rcm = recommendations['59cf98d54d539b618b307585'] %}
{% if rcm|length > 2 %}
{% for product in rcm %}
<tr>
  <td>
    <table>
      <tr>
        <td>
    <a href="{{ product.item_url }}"><img src="{{ product.image_url }}" alt="{{ product.item_name }}"/></a>
  </td>
  <td>
          <a href="{{ product.item_url }}">{{ product.item_name }}</a>
          <span>Price: {{ product.price }}</span>
            <table>
        <tr>
          <td>
      <a href="{{product.item_url}}">Add this item to cart</a>
          </td>
        </tr>
      </table>
   </td>
      </tr>
    </table>
  </td>
</tr>
{% endfor %}
{% endif %}

When you are done with editing and styling of your email, save it to use in the cart reactivation scenario.

Now we have followed all the necessary preparation steps and are ready to create a cart reactivation scenario.

Create a scenario

When your scenario is ready, it should look similar to this.

Create a scenario with the following components respectively:

  • Trigger event

We will trigger the campaign on every cart_update event, where the attribute which contains product ids (in this example it is the “products” attribute) has a value. The reason we do this is that we don’t want to trigger a cart reactivation campaign with an empty cart!

  • First condition checking whether the customer has email and is not unsubscribed

Next, we check whether the customer has email and whether they are unsubscribed. It is not essential to do this, as Exponea wouldn’t be able to send email to a customer without an email address and it automatically excludes unsubscribed customers from the email. However, it speeds up processing of this campaign.

  • Wait time

Let’s say we will give customers an hour, after which we will remind them what they left in their cart. You can choose wait time that makes sense for your business.

  • Second condition excluding customers who made more cart_updates afterwards or made a purchase

The second condition filters out customers who made a purchase in the last 60 minutes (customise the time to be exactly same to the wait time in the previous node). This is important, as we do not want to send a cart reactivation email to customers who actually finalised their purchase.

It also checks whether the timestamp of the last cart_update of this customer matches that of the event that triggered this campaign. In other words, we explore whether the specific cart update that triggered this campaign is the customer’s last one in the last hour and whether we can confidently send them an email.

  • A/B split allowing you to test the effectiveness of this campaign

In order to prove that this campaign has a positive effect on revenue, we strongly recommend to A/B test this campaign in the initial few weeks, until you have confident numbers.

  • Add the cart reactivation email you have previously created

Now is the time to finally add the email we want to send! Make sure to configure the subject line, sender name and address, policy and group. Leave the “Transfer identity to URL links” checked, so that you can track your customers effectively. You can read more about how to properly set up emails here.

Congratulations! You have just created a cart reactivation scenario. Test it out on yourself and once you feel confident, start the campaign live.

Advanced alterations

Below, you can find sample code and screenshots for advanced alterations of this campaign.

  • Custom wait time

It is a good idea to explore different wait times for different customers. You can enter this jinja into a custom wait node to send an email at the time the customer has last purchased and are therefore likely to be active.

{{ (((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24)) if   ((((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24) -3)>0) else  (((aggregates['592213934d539b19a436c1c2'] / 3600 + 2) % 24) - ((event.timestamp / 3600 + 2) % 24) +21) }}

The referenced aggregate is looking at last purchase timestamp aggregate, which looks like this.

  • Including vouchers

You can make use of Exponea’s voucher feature and send a personalised one-time voucher. You can read more about vouchers here. In order to include a voucher in the cart reactivation email, use the line of code below.

Use the discount code {{ vouchers['10%'].assign_available() }} to get a 10% discount and pay only {{ cartprice * 0.9 }}

You need to change the name of the voucher pool (“10%) and have the variable cartprice available in your email, in order for this to work.

 

Updated on October 13, 2017

Was this article helpful?

Related Articles