Tracking a complete cart
It’s recommended to use this method to track the entire cart once a visitor added anything to the cart.

Arguments

Argument
Type
Description
data
Object
See the list of possible properties below.
callback
function
Will be called without any arguments when cart tracking is finished. Optional.

Possible properties provided for data

Key
Type
Description
total
String
The total cart value. Optional.
url
String
A unique URL to the current cart instance including products. Optional.
email
String
The email address of the customer/visitor. Optional.
urls
List of Strings
A list of canonical urls of all the products in the cart.
productNumbers
List of Strings
A list of unique product numbers of all the products in the cart.
Examples:
Track using URLs
Track using Product Numbers
1
ADDWISH_PARTNER_NS.api.cart.setCart({
2
total: '123.50',
3
url: 'https://webshop.com/cart/123456789',
4
urls: [
5
'https://webshop.com/t-shirt.html',
6
'https://webshop.com/shoes.html'
7
],
9
},
10
function() {
11
console.log('Cart has been tracked');
12
});
Copied!
1
ADDWISH_PARTNER_NS.api.cart.setCart({
2
total: '123.50',
3
url: 'https://webshop.com/cart/123456789',
4
productNumbers: [
5
'p-1234',
6
'2134h'
7
],
9
},
10
function() {
11
console.log('Cart has been tracked');
12
});
Copied!
Last modified 1yr ago
Copy link