Cart abandonment (Add to Cart) using Dynamic Product Messaging and Jinja

Objective

To nudge a user to complete the purchase process by showing them the products which were added to the cart and not purchased.

 

PREREQUISITES

  1. A feed with all the details of the campaign content, for more info please follow the below link: Create Product Catalogs
  2. A working DPM is set up with the following configuration, please follow the below tech doc to set up DPM in your dashboard: Create Product Sets 

CreatePdtSet.png

For view events, use the view event configuration. The data tracking can be enabled for 2 or more days.

Create an Event Trigger Campaign

Once the above prerequisites are met, an event trigger campaign is to be created with an add to cart event or view event and the following jinja code. Notification triggers can be set to a few hours post the event or as required. 

The following can be the title for the notification sent: 'You have items in your cart that may go out of stock.'

Message:
Following products are in your cart 
{% if ProductSet.AddToCartProductset%}
    {% for product in ProductSet.AddToCartProductset[0:5]%}
        {% if product.title%}
            {{product.title}}
        {% else %}
            "Alternate title"
        {% endif %}
    {% endfor %}
{% else %}
    MOE_DONT_SEND
{% endif %}
Image link:
{% if ProductSet.AddToCartProductset%}
  {% for product in ProductSet.AddToCartProductset[0:5]%} 
     {% if product.image_link%}   
        {{product.image_link}}
     {% else %} 
        MOE_DONT_SEND
     {% endif %}
  {% endfor %}
{% else %} 
  MOE_DONT_SEND
{% endif %}
 

NOTE

The campaign might show personalization errors for the users who have viewed/added the product to the cart and if these products are not present in the feed. Also, note that [0:5] can be used to show the latest 5 add-to-cart products in the above code. This number can be changed as per the requirement. However, for images, push notifications support only one image per notification so [0:1] is used.

Was this article helpful?
3 out of 5 found this helpful