Web Analytics

In your extended Shop settings, you’ll find the “Web analytics” option to help you analyze customer behavior with analytics tools.

Connect your Google Analytics and Facebook Pixel with the input fields you will find there.

In the section “More tracking tools”, you can insert your own code to use tools from other providers such as hotjar or crazyegg, etc. You can even define your own tracking code.

You can track the following events:

Event Is triggered if a customer...
onUpdate ...changes the category (men, women, etc.) or moves from a list page to a detail page.
onAddToBasket ...puts an item in the cart.
onBasketChange ...makes changes in the cart (deletes items, changes quantity/size, redeems coupon).
onCheckoutStep ...gets a step closer to checkout (e.g. from address to payment options).
onOrderSuccess ...completes an order successfully.

This is how you integrate your code in the input field.

    window.sprdShop.onUpdate(function (data) { console.log(data); });
    window.sprdShop.onAddToBasket(function (item) { console.log(item); });
    window.sprdShop.onBasketChange(function (data) { console.log(data); });
    window.sprdShop.onCheckoutStep(function (data) { console.log(data); });
    window.sprdShop.onOrderSuccess(function (data) { console.log(data); });

This code will only issue objects in consoles so you can check whether everything works. Then replace console.log(data); with the code of the analytics tool you use so that it makes it into your shop and you can track visitor behavior. The events onBasketChange, onOrderSuccess and onCheckoutStep will only be issued once the customer gets to the checkout.

Was this article helpful?