When creating a custom campaign, rule, or goal, you can call these predefined functions where applicable.
Detect if the user is on the cart/basket page
The following function detects if the current page is the cart/basket page.
| Function Call | Returns |
|---|---|
| Insider.systemRules.call('isOnCartPage'); | Boolean |
Insider.systemRules.call('isOnCartPage');For example, the response below returns if the current page is a cart/basket page.
Get the product(s)/item(s) in the cart
The following function collects product information on the cart page. If your website has a mini cart that shows the product(s) in the cart on any page other than the cart page, this function also collects the product(s) information.
| Function Call | Returns |
|---|---|
| Insider.systemRules.call('getPaidProducts') | Array |
Insider.systemRules.call('getPaidProducts')For example, the response below returns the products in the cart.
Get the number of product(s)/item(s) in the cart
The following function collects the number of products on the cart/basket page.
| Function Call | Returns |
|---|---|
| Insider.systemRules.call('getCartCount') | Number |
Insider.systemRules.call('getCartCount')For example, the response below returns the number of products in the cart/basket.