Skip to content

analytics.viewedBasket

analytics.viewedBasket is an event on the Event Bus that occurs after a user has viewed a basket. This event only dispatches when analytics is enabled in the shop.

Event body

none

Example

In this example we listen to analytics.viewedBasket event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    storefront.eventBus.on('analytics.viewedBasket', () => {
        console.log('A user has viewed a basket')
    });
});