Abandoned cart recovery is one of the most important campaigns that a e-commerce marketer can run. In order to work, the cart data itself must be sent to Remarkety so that we can send out the proper emails and help you recover revenue! This article talks about the technical steps necessary to send the data to Remarkety - it does not discuss how to set up the actual campaigns.

Important: If you are on one of our supported platforms and are using our plugins or app, we've already done the work for you and this article is not necessary. These instructions are for custom integrations.

The easiest and fastest way to send the cart data to Remarkety is though our website integration. This means that when shoppers browse your website, the page will send their cart data immediately when they create or update their cart.


Remarkety's tracking code needs to be installed on (preferably) every page of your website. The script loads asynchronously and will not degrade the load time of your website.

First, you will need to know the STORE_ID of your Remarkety account. You can find this in the Settings -> API Keys section:



On your website, include the following code on every page, just before the closing </body> tag. Remember to replace STORE_ID with the actual value you found above. This loads the tracking script:

<script>var _rmData = _rmData || [];
   _rmData.push(['setStoreKey', 'STORE_ID']);
<script>(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = 'https://d3ryumxhbd2uw7.cloudfront.net/webtracking/track.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));</script>

Shopper Identification

There are several ways to identify who's actually browsing right now. Many of your shoppers will be anonymous, ie they found you on Google (for example) and have never signed up or logged in. These users cannot be sent any emails (obviously..) because we don't know their email address. However, there are several ways the script can identify the user's email:

  1. If the user is logged in to your website, add this snippet of javascript somewhere along the page, with the user's email filled in instead of USER_EMAIL:
    _rmData = _rmData || [];
    _rmData.push(["setCustomer", "USER_EMAIL"]);
  2. The tracking script will automatically identify the user's email if:
    • The user has clicked through to the website from an email sent by Remarkety, or
    • The user has signed up using Remarkety's popup

Sending the Cart Contents

After identifying the user (if possible, not necessary) you then need to send Remarkety the actual contents of the cart. The cart needs to be constructed as a JavaScript object, which is then passed into the tracking script. For example:

var cart = {
"total_price": 9.98,
"subtotal_price": 19.98,
"line_items": [
"product_id": 1,
"quantity": 2,
"sku": "ABC",
"title": "This is a product",
"vendor": "(optional) Vendor of the product",
"price": 9.99,
"total_price": 19.98,
"url": "https://my.demo.store/product.html"
"discount_codes": [{
"code": "summer-sale",
"amount": 10,
"type": "fixed"
_rmData = _rmData || [];
_rmData.push(['track', 'carts/updated', cart]);

Cart Object

The cart object must contain the following properties:

Property Type Mandatory? Purpose / Example
subtotal_price float yes Subtotal - items only, before taxes, shipping and discounts
total_discounts float no

Total of discounts applied to this order

total_shipping float no Total of shipping costs
total_tax float no Total of taxes applied to the order
total_price float yes The total price of the cart, after shipping, taxes and discounts.
Ie: 199.95
discount_codes array of objects no All the discounts applied to the cart
discount_codes[].code string no The coupon code
discount_codes[].amount float no The discount amount, either in nominal terms or as a percentage of the subtotal. Specify the "type" to differentiate between the two
discount_codes[].type string no Type of discount. Valid values: "fixed", "percent"
line_items array of objects yes Specify the contents of the cart
line_items[].product_id integer yes The internal (ie - your own website's) product id of this item.
line_items[].quantity integer yes Number of items this cart contains
line_items[].sku string no The SKU of the product
line_items[].title string yes The (short) name of this product
line_items[].vendor string no The name of the product's vendor
line_items[].price float yes The price for a single item
line_items[].total_price float yes The total line item price. Usually price*quantity, but you may have applied a volume discount here..
line_items[].url string yes The full link to the original product's page on your website
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.