Cart Abandonment is any representation of a visitor adding items to the cart and not purchasing. This post describes how to setup Cart Abandonment within AudienceStream. The example discussed below will explore the use case where a visitor adds a product to the cart and then the session ends without an order completion event.

In this article:

Table of Contents Placeholder

Prerequisites

Events tracking: add to cart event & puchase event

Before setting up Cart Abandonment user case, we will need to ensure add to cart and puchase event are being sent to AudienceStream.

Setup add to cart event using jQuery onHandler extension in Tealium iQ

For tracking the click event of a product being added to the cart, a utag.link() call is required so that the event and product information can be sent to AudienceStream. Here is a sample jQuery onHandler extension that shows the event and product information being declared.

jQuery onhandler examplejQuery onhandler example

The utag.link() will trigger the Tealium Collect Tag to fire and automatically send this information to AudienceStream even if no tags fire.

No matter the cart action, the product information needs to be made available. This is because Cart Abandonment is usually tied to an email campaign which will reference the products added to the cart. The product information will help the user be targeted correctly.

AudienceStream Setup

Attributes: "Has Added to Cart" Boolean

Create a Visit Boolean attribute titled "Has Added to Cart". We will need to apply two Enrichments to the Flag:

Our first Enrichment sets the "Has Added to Cart" boolean to false at the beginning of every new visit (session). The logic is "any time a new visit occurs set the boolean to 'False'".

AS_boolean_set_to_false_new_visit.png

The second Enrichment sets the "Has Added to Cart" boolean to "True" any time an Add to Cart event occurs. We will need create a rule that determines when an Add to Cart event occurred. Looking at the onHandler above we can use the "tealium_event" parameter and when it equals "add_to_cart" we know it's the correct event.

AS_rule_added_to_cart.png

This allows us to distinguish at the visit level whether or not an Add to Cart event occurred.

Attributes: "Has Completed an Order" Boolean

Next, we need to create another Visit Boolean attribute titled "Has Completed an Order". We will need to apply two Enrichments to the Flag:

The first Enrichment, similar to the first Enrichment on the "Has Added to Cart" boolean will set the "Has Completed an Order" boolean to false at the beginning of every new visit. 

AS_boolean_set_to_false_new_visit.png

The second Enrichment for Has Completed an Order will set the flag to "True" when a visitor reaches the Order Confirmation page. We will need to create a rule that determines when an Order confirmation page has been reached. Similar to the identification of add to cart event, we could use the "tealium_event" parameter. 

AS_rule_order_completed.png

This allows us to distinguish at the visit level whether or not an Order has been submitted.

Attributes: Badge

Now that we have the basics in place to track an Add to Cart event and Order Complete event, we can build the logic to determine the Cart Abandonment.

The logic is: "If an Add to Cart event occurred and at the end of the visit there is not an Order Complete event then apply the Badge."

Create a Badge named "Cart Abandoner" that is applied when the "Visit ended" and Cart Abandoned rule is evaluated to true, where "Has Added To Cart" is true and "Has Completed an Order" is false.

AS_badge_cart_abandoner.png

Explanation

  • When a new visitor enters the site, both the "Has Added To Cart" and "Has Completed an Order" booleans are set to "False".
  • When a product is added to the cart, the "Has Added To Cart" boolean is changed to "True" while the "Has Completed an Order" boolean remains false.
  • These values will persist until either one of two actions occur.
    1. If an order is completed then the "Has Completed an Order" boolean is changed to "True". At the end of the session the "Cart Abandoned" rule will not evaluate to true so the Badge will not be assigned.
    2. If an order is not completed then the "Has Completed an Order" flag will remain "False". At the end of the session the "Cart Abandoned" rule will evaluate to true so the Badge will be assigned.

Audience: Cart Abandoners

Now that the Badge has been configured, an Audience needs to be created so that a Connector can take action.

Create Audience named "Cart Abandoners" with condition "Cart Abandoner" Badge is assigned.

AS_audience_cart_abandoners.png

Connectors

Now that an Audience has been created, any Connector can be configured to use the Audience. 

Learn more about setting up connectors.

Version history
Revision #:
11 of 11
Last update:
a month ago
Updated by: