//Granify Android SDK/com.granifyinc.granifysdk/Granify/trackCart
trackCart
[androidJvm]\
fun trackCart(items: Map<Product, Int>)
Notifies Granify of the contents of the shopper’s cart.
All cart information is required (rather than partial changesets) to sync the customer’s cart with Granify. Ensuring that this information is kept up to date is crucial to enable cart-related campaigns to work.
Placement
This function should be called:
- On initial app launch.
- After there is any change made to the cart. This includes:
-
- After a purchase is completed (to clear the cart); including through the use of a "Buy It Now" or other express purchase button.
- The removal of an item.
- Cart item quantity changes.
- Updated cart information from a server response (e.g. from shopping performed on the same user account on a different device).
Parameters
androidJvm
items | A map containing carted products as keys and corresponding cart quantities as values. |