Javascript API Reference

The Rejoiner API is an optional add-on to your Rejoiner tracking and conversion code that allows retailers to pass transactional data from the cart. All API calls must be formatted exactly as seen below and they must be placed below the required Rejoiner tracking and/or conversion JavaScript include tags.

setCartData Overview

The setCartData method is intended for passing order level data about the abandoned transaction.

Attribute Required Type Notes
email No String The email address of a customer if they are logged in
returnUrl No String This is a unique url that should regenerate the cart
totalItems No Integer The total number of items in the cart
value No Integer This is the total value of the cart in CENTS. (e.g. 5999 = $59.99)
customer_order_number No String A unique order number or confirmation number
promo No String A unique promo code or coupon

setCartItem Overview

The setCartItem method is intended for passing individual characteristics about specific items in the cart.

Attribute Required Type Notes
product_id Yes String This value should be a SKU or unique identifier from your system
name No String This is the name of the item being added to the cart
description No Integer This is a description of the item being added to the cart
price No Integer This is the price of the specific item being added to the cart in CENTS. (e.g. 5999 = $59.99)
image_url No String This is an absolute url linked to the product image for the specific item being added to the cart.
item_qty No Integer The quantity of an item in the cart
qty_price No Integer This is the price x quantity of an item in CENTS
product_url No String The product page URL of a cart item
category No String The category of a cart item

Advanced Parameters

Advanced options to give you more control over Rejoiner's tracking.

Parameter Notes
_rejoiner.push(["persistForms"]); If a customer returns to the checkout page, fields will repopulate with the data they entered prior to abandoning.
_rejoiner.push(["trackNumbers"]); Enable Rejoiner to capture phone numbers from your checkout form.
_rejoiner.push(["setExcludeFieldID", ["FieldID1"]]); Filter defined field IDs
_rejoiner.push(["setExcludeFieldName", ["FieldName1", "FieldName2"]]); Filter defined field names

Sample API Usage

<!-- Rejoiner Tracking -->

<script type='text/javascript'>
var _rejoiner = _rejoiner || [];
_rejoiner.push(['setAccount', 'YOUR_REJOINER_SITE_ID_HERE']);
_rejoiner.push(['setDomain', '.yoursiteurl.com']);


(function() {
    var s = document.createElement('script'); s.type = 'text/javascript';
    s.async = true;
    s.src = 'https://s3.amazonaws.com/rejoiner/js/v3/t.js';
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
})();
</script>

<script type='text/javascript'>
    _rejoiner.push(['setCartData', {
        'value': '5999',
        'totalItems': '3',
        'returnUrl': 'http://yoursite.com/regeneratecart'
    }]);

    _rejoiner.push(['setCartItem', {
        'product_id': 'ITM1',
        'qty_price': '39998',
        'name': 'Item Name',
        'description': 'This is a long string of text about the item',
        'price': '19999',
        'image_url': 'http://yoursite.com/path/to/image.jpg'
    }]);

    _rejoiner.push(['setCartItem', {
        'product_id': 'ITM2',
        'name': 'Item 2 Name',
        'description': 'This is a long string of text about item 2',
        'price': '2999',
        'image_url': 'http://yoursite.com/path/to/image2.jpg'
    }]);
</script>

<!-- End Rejoiner Tracking -->
Copy Code ยป
<!-- Rejoiner Tracking -->

<script type='text/javascript'>
	var rejoiner = rejoiner || [];
	rejoiner.setAccount = 'YOUR_REJOINER_SITE_ID_HERE';
	(function() {
	    var s = document.createElement('script'); s.type = 'text/javascript';
	    s.async = true;
	    s.src = 'https://rejoiner.s3.amazonaws.com/js/v2/t.js';
	    var x = document.getElementsByTagName('script')[0];
	    x.parentNode.insertBefore(s, x);
	})();
</script>

<script type='text/javascript'>
	rejoiner.addCartData = [{
        'totalItems' : '2',
        'value' : '23998', //in cents
        'returnUrl' : 'http://yoursite.com/regeneratecart',  //absolute url
        'email' : 'customer@example.com'
	}];

	rejoiner.addCartItems = [{
        'name': 'Item Name',
        'image_url': 'http://yoursite.com/path/to/image.jpg', // absolute url
        'price': '18499', //in cents
        'product_id': 'ITM1', //required
        'item_qty': '1',
        'qty_price':'18499' //in cents
    },{
        'name': 'Item 2 Name',
        'image_url': 'http://yoursite.com/path/to/image2.jpg', // absolute url
        'price': '5499', //in cents
        'product_id': 'ITM2', //required
        'item_qty': '1',
        'qty_price':'5499' //in cents
	}];
</script>

<!-- End Rejoiner Tracking -->
v1.0 tags are not compatible with the Javascript API.
×