Skip to main content

Analytics events

The Selektable widget emits events to the host page at key moments in the customer journey. You can listen to these events to send data to your own analytics tools like Google Analytics, Meta Pixel, Mixpanel, Segment, or any other platform.

Available events

Listening to events

The widget communicates with the host page using the browser’s postMessage API. Add a listener on window to receive events:

Event lifecycle

Events fire in the following order during a typical customer interaction:

Event payloads

widget:ready

Fires when the widget iframe has finished loading and is ready for interaction.

widget:modal-close

Fires when the customer closes the widget (back button, close button, or clicking outside).

widget:error

Fires when an error occurs in the widget (file too large, generation failed, network error, etc.).

widget:add-to-cart

Fires when the customer clicks “Add to Cart” on the visualization result screen.

widget:view-cart

Fires when the customer clicks the “View Cart” button.

widget:checkout

Fires when the customer clicks the “Checkout” button.

Integration examples

Google Analytics 4

Meta Pixel

Segment

Mixpanel

Full example

A product page that tracks all widget events to Google Analytics 4:
The postMessage listener receives messages from all iframes on the page, not just Selektable. Always check that data.type starts with widget: to avoid handling unrelated messages.

Next steps

Conversion tracking

Track purchases and leads to measure widget impact

Identity tracking

Associate events with logged-in customer accounts