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.
{
  "event": "molin_chat_open",
  "widget_id": "abc123"
}
ParameterTypeDescription
widget_idstringThe unique ID of the Molin widget

molin_chat_close

Fired when the user closes the chat window.
{
  "event": "molin_chat_close",
  "widget_id": "abc123"
}
ParameterTypeDescription
widget_idstringThe unique ID of the Molin widget

molin_message_sent

Fired when the user sends a message in the chat.
{
  "event": "molin_message_sent",
  "widget_id": "abc123"
}
ParameterTypeDescription
widget_idstringThe unique ID of the Molin widget
Fired when the user clicks a link inside a Molin AI widget conversation.
{
  "event": "molin_link_click",
  "widget_id": "abc123",
  "url": "https://yourstore.com/product/123"
}
ParameterTypeDescription
widget_idstringThe unique ID of the Molin widget
urlstringThe URL of the clicked link

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.
{
  event: 'view_item_list',
  ecommerce: {
    item_list_id: 'molin_ai_chat',
    item_list_name: 'Molin AI chat',
    items: [
      {
        item_name: 'Adidas Ultraboost 5',
        index: 0,
        item_list_id: 'molin_ai_chat',
        item_list_name: 'Molin AI chat',
        price: 189.99,
        google_business_vertical: 'retail'
      },
      {
        item_name: 'Adidas Gazelle Bold',
        index: 1,
        item_list_id: 'molin_ai_chat',
        item_list_name: 'Molin AI chat',
        price: 119.99,
        google_business_vertical: 'retail'
      }
    ]
  }
}

select_item

Fired when the user clicks on a product card link. Identifies which product was selected from the recommendation list.
{
  event: 'select_item',
  ecommerce: {
    item_list_id: 'molin_ai_chat',
    item_list_name: 'Molin AI chat',
    items: [
      {
        item_name: 'Adidas Ultraboost 5',
        index: 0,
        item_list_id: 'molin_ai_chat',
        item_list_name: 'Molin AI chat',
        price: 189.99,
        google_business_vertical: 'retail'
      }
    ]
  }
}

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.
{
  event: 'view_item',
  ecommerce: {
    items: [
      {
        item_name: 'Adidas Ultraboost 5',
        index: 0,
        item_list_id: 'molin_ai_chat',
        item_list_name: 'Molin AI chat',
        price: 189.99,
        google_business_vertical: 'retail'
      }
    ]
  }
}

E-commerce item fields

FieldTypeDescription
item_namestringProduct name from the product catalog
indexnumberPosition of the product in the recommendation list
item_list_idstringAlways molin_ai_chat
item_list_namestringAlways Molin AI chat
pricenumberProduct price parsed from the catalog
google_business_verticalstringAlways retail
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.