Setting up giosg BASKET
Giosg BASKET is an additional product for Giosg Live. With basket you can monitor and analyze visitor's shopping carts in real time and generate different kinds of reports afterwards.
How to setup basket tracking¶
Implementing giosg Basket¶
Implementing giosg Basket requires site owners to make changes to their website's code but the changes are trivial and can be easily placed next to the code that tracks e-commerce events to other analytics platforms. This way the developers of the site can decide what to track and can make sure that the data submitted to giosg is same as submitted to other analytics services.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
You can submit cart data by passing
Giosg automatically tracks the state of the cart on the server and removes products from cart that are not present on the latest data set that was submitted to server. This means that you don't need to manually keep track which products to remove and which products to add to cart.
It is recommended you to set the currency before using the basket api through the
setCurrency api. By default the api uses currency from the company settings.
Marking cart as purchased¶
NOTE: Giosg sales tracking requires carts to be marked as purchased. Tracked sales will not show up in reporting until the cart has been marked purchased.
When visitor makes a payment, navigates to success page or does some other action which causes the cart to be purchased
giosg.api.shoppingCart.freeze() method to mark cart purchased.
This method doesn't need any parameters as the current cart contents should have been already submitted with
submit method. If the cart data does not exists or freezing failed for some reason then this method will reject the promise.
See usage examples on the right side.
1 2 3 4 5 6 7 8 9 10
Removing products from cart¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Giosg automatically tracks the state of the cart on the server and removes products from cart that are not present on the latest data set that was submitted to server. So to remove products from cart you can just submit new set of products that still are on visitors cart. If the visitors cart is completely empty then you should use
giosg.api.shoppingCart.clearCart() to remove all products from the cart.
1 2 3 4
To remove all products from cart use
giosg.api.shoppingCart.clearCart(). This removes all the products from the cart on the server.
Supported fields on Product object¶
Supported fields on
||string||required||Name of the product|
||string||required||Price of the product in decimal format, for example "10.50". Max 2 decimals is supported|
||integer||required||Count of this kind of product in cart.|
||string||optional||Longer description of the product|
||string||optional||Monthly billable price of the product in decimal format, for example "9.90". Max 2 decimals is supported|
||integer||optional|| Monthly plan length (Deprecated: Use
||integer||optional||Monthly plan length|
||string||optional||Category of the product|
||string||optional||Product number or code. For example "313" or "SKU-234"|
Checklist for integration¶
- After you have done the setup
- Check that cart information is shown correctly on giosg Live chat dialog.
- Wait a couple of days and compare that store's actual sale and giosg's reports match.
Collected cart data does not match actual sales?¶
This can happen for number of reasons. Giosg cannot ensure that the data is always correct and matches with actual shop database or other analytics services. Neither can other analytics services ensure that.
Most common reason however when data doesn't match is usually on basket configuration. Please check that the basket is configured correctly and carts are marked as purchased on success page.
This is due to fact that the data is transmitted from client (browser) which may block the request for number of reasons. Also it is possible that there is network errors or outages in which case giosg will retry until succeeded but success cannot be verified.
Also make sure that the data submitted takes discounts and delivery fees into account if you are comparing it to report that also takes these factors into account.