Objective: To get a user to complete the purchase process by showing them the products which were added to the cart and not purchased.
Prerequisites:
-> A feed with all the details of the campaign content, for more info please follow the below link
https://help.moengage.com/hc/en-us/articles/115003793323-Create-Product-Catalogs
-> A working DPM set up with the following configuration, please follow the below tech doc to set up DPM in your dashboard.
https://help.moengage.com/hc/en-us/articles/115004239526-Create-Product-Sets
Note - For view events, use the view event configuration. The data tracking can be enabled for 2 or more days.
Once the above prerequisites are met, a smart trigger campaign to be created with an add to cart event or view event and the following jinja code. Notification trigger can be set to a few hours post the event or as required.
Title - Your have items in your cart which may go out of stock.
Message -
Following products are in your cart {% if ProductSet.AddToCartProductset%}{% for product in ProductSet.AddToCartProductset[0:5]%} {{product.title}}{% else %} MOE_DONT_SEND_NOTIFICATION {% endif %}{% endfor %}{% else %} MOE_DONT_SEND_NOTIFICATION {% endif %}
Image link -
{% if ProductSet.AddToCartProductset%}{% for product in ProductSet.AddToCartProductset[0:1]%}{{product.image_link}}{% else %} MOE_DONT_SEND_NOTIFICATION {% endif %}{% endfor %}{% else %} MOE_DONT_SEND_NOTIFICATION {% endif %}
Note - 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.