Website Personalization Using Rekko Merge Tags
July 7, 2015
How to Create an A/B Testing Campaign
July 16, 2015

Support for Ajax Shopping Carts

More and more shopping cart platforms allow visitors to add products to cart without having to go to the shopping cart page. It makes for a great shopping experience as visitors can just keep adding products to their cart.

If you utilize this type of shopping cart, or are thinking about moving your platform towards it, Rekko can accommodate your needs and make sure we’re capturing data each time someone adds to their cart from any page.

Why is this so useful? Knowing what a visitor adds to their cart and for how much gives you the opportunity to further personalize a visitor’s experience while they’re shopping. You’ll be able to up-sell or cross-sell with other products, display promotions geared towards what and/or how much was added, or even recommend products based on what they showed interest in.

Carts that support this functionality are using Ajax to add to cart without having to refresh the page or go to the cart page each time. We’ve laid out the steps below to help you get your site tagged for whenever a visitor clicks that add to cart button.

How to pass cart info to Rekko with your Ajax ‘Add to Cart’ Button

Upon clicking ‘Add to Cart’, update Rekko cart information by calling the following function without a page reload. At this point, campaigns scheduled to deliver after page load and upon adding to cart will be triggered.

<script type=”text/javascript”>
if (window.convert && window.convert.updateCart) {
convert.updateCart(@TOTALCOST@, @CONVERT_ITEM@);
}
</script>

Where @TOTALCOST@ refers to the total cost of the shopping cart after the product is added and @CONVERT_ITEM@ refers to the product with SKU, Category, Price, and Quantity.

Both of these values are optional, of course. You could just pass Rekko the cart total, just the cart items info, or both. It’s up to you, but more is always better!

When passing the cart item information, SKU is mandatory.

Example of just cart total being updated: Where cart total is being updated to 500 in Rekko after someone clicks ‘Add to Cart.’

<script type=”text/javascript”>
if (window.convert && window.convert.updateCart) {
convert.updateCart(500);
}
</script>

Example of both cart total and cart item info being updated.

<script type=”text/javascript”>
if (window.convert && window.convert.updateCart) {
convert.updateCart(500, {sku:”msj012c”, category:”Men,New Arrivals,Blazers”,quantity:1,price:125});
}
</script>