Skip to main content
The Molin AI widget automatically sends interaction data to your website’s Google Analytics through Google Tag Manager (GTM) integration, allowing you to track how users engage with the AI assistant on your site.

What is the dataLayer integration?

The dataLayer integration automatically pushes events to the browser’s window.dataLayer object when users interact with the Molin AI widget. All events are sent automatically, so no configuration is required on your part.

Custom events

molin_chat_open

Fired when the user opens the chat window.

molin_chat_close

Fired when the user closes the chat window.

molin_message_sent

Fired when the user sends a message in the chat.
Fired when the user clicks a link inside a Molin AI widget conversation.

molin_lead_collected

Fired when the AI successfully collects a lead (the visitor’s name and contact details) in the chat. This is the strongest conversion signal the widget emits. Unlike engagement events such as molin_chat_open or molin_message_sent, it fires only when a real lead was captured, so it is the recommended event for conversion tracking and ad campaign optimization.
To optimize ad campaigns on Molin leads: create a GTM trigger for the molin_lead_collected dataLayer event, forward it to GA4 as a custom event, then mark it as a key event in GA4 and import it as a conversion in Google Ads.

molin_order_lookup

Fired when the AI finds a customer’s order and shows its details in the chat (order status, tracking, items). A useful signal for measuring support automation.

molin_live_chat_requested

Fired when the AI successfully starts a live chat request, escalating the visitor to a human support agent. It does not fire when agents are unavailable or the request fails.

molin_product_review_shown

Fired when the AI shows customer product reviews in the chat.

GA4 e-commerce events

The widget also pushes standard GA4 e-commerce events so that AI-driven product recommendations appear natively in your Google Analytics e-commerce reports.

view_item_list

Fired when the AI recommends products in the chat. Each product is included as an item.

select_item

Fired when the user clicks on a product card link. Identifies which product was selected from the recommendation list.

view_item

Fired alongside select_item when the user clicks a product card link. This event is used by GA4 to track product detail views.

E-commerce item fields

The price field may be 0 in some cases. We are still upgrading our internal price parsing logic to cover all catalog formats reliably.

Technical note

Before each e-commerce event, the widget pushes { ecommerce: null } to clear the previous e-commerce object, following Google’s recommended practice.