A callback function, to which the API response will be passed. Response type: object.
error
function
optionally
A callback function that will be called when an error occurs (any HTTP status code other than 200).
API response
Name
Type
Description
now
object
The product interaction counters for the last 15 minutes.
The following properties are available:
view (number) - the number of product views
cart (number) - the number of times product is added to the cart
purchase (number) - the number of product purchases
daily
object
The product interaction counters for the last 24 hours.
The following properties are available:
view (number) - the number of product views
cart (number) - the number of times product is added to the cart
purchase (number) - the number of product purchases
Example of use
personaclick("products", "counters", 100500, function(counters) {
console.log(counters.now.view); // views in the last 15 minutes
console.log(counters.daily.purchase); // purchases in the last 24 hours
});
Get User's Current Cart
Method Objective
The method allows getting the current profile's cart.
Syntax and parameters
personaclick("cart", "get", success, error);
Name
Type
Requirement
Description
success
function
required
A callback function, to which the API response will be passed. Response type: object.
error
function
optionally
A callback function that will be called when an error occurs (any HTTP status code other than 200).
API response
Name
Type
Description
status
string
Contains "success" if the request is successful.
data
object
Contains the "items" object array, where each object contains the following properties: