Skip to content

Track widget events in GA4 / GTM ​

The chat widget can mirror its interaction events into your site's window.dataLayer, where Google Tag Manager (or any tag management system reading the dataLayer) picks them up. From there, forward them to GA4, Meta, or any destination you already manage in your TMS: chat opens, messages sent, products added to cart from the chat, handoffs, CSAT, appointments.

This is on by default, with no integration change and no listener script needed: the widget pushes directly into the dataLayer. You can turn it off anytime in your dashboard, under Settings → Company → Analytics (GTM / GA4).

Pushing into the dataLayer has no effect on its own: nothing reaches GA4 (or any other tool) until you create the matching triggers and tags in your TMS. Sites without a TMS are unaffected.

Every event below is pushed as it happens:

js
// What a push looks like
{
  event: 'humind_message_sent',
  humind: {
    source: 'typed',
    has_product_context: false,
    has_attachments: false,
    is_first_message: true
  }
}
  • Event names are prefixed humind_ so they never collide with your own dataLayer conventions and are trivial to filter.
  • Event parameters live under the humind key. Before each push the widget resets it ({ humind: null }), the same pattern GA4 documents for ecommerce, so parameters from a previous event never leak into the next one.

Set up GTM → GA4 ​

  1. Variables: create Data Layer Variables for the parameters you care about, e.g. humind.product_id, humind.source, humind.sentiment.
  2. Trigger: create a Custom Event trigger. Either one per event (humind_message_sent), or a single catch-all with "Use regex matching" and the pattern humind_.*.
  3. Tag: create a GA4 Event tag fired by that trigger. Use the built-in variable as the event name to forward the humind_* name as-is, and map your Data Layer Variables as event parameters.

For cart events you can instead map to GA4's recommended e-commerce events (add_to_cart / remove_from_cart) in your tag configuration; humind_product_added_to_cart carries product_id, product_variant_id, price and source (the button that added it).

Event reference ​

Engagement ​

EventParametersFired when
humind_launcher_shown-The floating chat button is first rendered on the page (once per page view).
humind_nudge_showntypeA proactive message bubble appears above the launcher.
humind_nudge_clickedtypeThe visitor clicks the proactive bubble.
humind_nudge_dismissedtypeThe visitor dismisses the proactive bubble.
humind_widget_opened-The chat panel opens (any path: launcher, nudge, custom trigger).
humind_widget_closed-The chat panel closes.

Conversation ​

EventParametersFired when
humind_message_sentsource, has_product_context, has_attachments, is_first_messageThe visitor sends a message. source tells you how it originated (typed, quiz, a suggested question…).
humind_assistant_respondedanswer_type, had_productsThe AI finished a reply. had_products is true when product recommendations were shown.
humind_new_conversation_started-The visitor starts a fresh conversation.
humind_conversation_resumed-The visitor reopens a past conversation from history.
humind_message_feedback_submittedsentimentThe visitor rated an AI answer (thumbs up/down + optional details).

Products & cart ​

EventParametersFired when
humind_product_card_shownproduct_id, positionA recommended product card is displayed (once per product per message).
humind_product_page_openedproduct_id, sourceThe visitor opens a product's page from the chat. source is one of: product_card (recommended card in the conversation), quiz_hero (quiz result card), quiz_alternatives (alternatives list under a quiz result), comparison_table (comparison table), sticky_bar (product bar under the header), product_page (product page inside the chat), variant_picker (variant picker), cart_sheet (the cart card), product_chip (product chip), product_sheet_swipe (swipe to the previous or next product inside the mobile product sheet).
humind_product_url_openedproduct_id, sourceThe visitor follows a product link from the chat. source: same values as humind_product_page_opened.
humind_product_added_to_cartproduct_id, product_variant_id, price, sourceThe visitor adds a product to the cart from the chat. source: same values as humind_product_page_opened, so you can compare which button converts.
humind_product_removed_from_cartproduct_id, product_variant_id, price, sourceThe visitor removes a product from the cart in the chat.
humind_cart_opened-The visitor opens the cart from the chat header.

Human handoff & satisfaction ​

EventParametersFired when
humind_handoff_requested-The conversation is escalated to a human operator.
humind_handoff_accepted-An operator picks up the conversation.
humind_handoff_resolved-The operator resolves the conversation.
humind_csat_shownsourceThe satisfaction survey is displayed. source is ai (end of an AI conversation) or human (end of an operator handoff).
humind_csat_dismissedsourceThe visitor dismisses the survey without rating.
humind_csat_submittedrating, sourceThe visitor submits a satisfaction rating (1 to 5).
humind_support_button_clickedbutton, channel_type, channel_titleThe visitor clicks a support channel button. button is the channel preset (phone, email, contact_us, whatsapp…) or the custom channel's id, channel_type its mechanism (phone, email, link, js_script), channel_title its label as configured in your dashboard.
humind_article_ratedarticle_id, ratingThe visitor rates a help-center article.

Leads & appointments ​

EventParametersFired when
humind_pre_chat_survey_submitted-The visitor submits the pre-chat contact form.
humind_appointment_calendar_showntypeThe booking calendar is displayed in the chat.
humind_appointment_slot_selected-The visitor picks a time slot.
humind_appointment_lead_captured-The visitor submits their contact details for a booking.
humind_appointment_bookedduration_minutesThe booking is confirmed.
humind_appointment_cancelled-The visitor cancels a booking from the chat.

Choose which events are pushed ​

Both options live under Settings → Company → Analytics (GTM / GA4), below the main toggle. They are made for sites billed per hit (GA4 360, server-side GTM) or that simply want a quieter dataLayer.

  • Once per visit. With "Send each event only once per visit" on, each event is pushed the first time it fires in a session, then silenced for the rest of that visit (per browser tab, across page loads and in-site navigation). The limit applies per event name, not per product: humind_product_card_shown is then pushed for the first card of the session only. Off by default.
  • Event selection. Each event can be switched off individually: it is then never pushed. By default every event is pushed. As soon as you customise the list, it becomes authoritative: events Humind adds later stay off until you enable them, so a new event can never add hits to your bill on its own.

Both settings are also available over the API as tracking.data_layer_once_per_session and tracking.data_layer_events on the Settings endpoint: event names without the humind_ prefix, null restoring the default list.

These filters only affect the dataLayer mirror. Humind's own analytics and your dashboard reports are unchanged.

  • No personal data leaves the widget. Payloads never contain message text, contact details, or visitor identifiers, only interaction facts (event name, product IDs, counts, ratings).
  • Pushed regardless of cookie consent, by design. A dataLayer push stores no cookie, carries no identifier and makes no network call: nothing reaches GA4 (or anyone) until one of your tags fires. Enforce consent where it belongs, on your tags (e.g. GTM Consent Mode), exactly as you already do for your own page_view and ecommerce pushes. This also keeps pre-consent events available for Consent Mode's cookieless pings and lets you measure widget exposure across all visitors.
  • You stay in control. The widget only writes to the dataLayer; which events become GA4 hits (or anything else) is decided entirely by the tags you configure. To stop the pushes altogether, disable the setting under Settings → Company → Analytics (GTM / GA4).

This section only covers the merchant's dataLayer. For functional widget storage and Humind usage measurement with PostHog, see the tracker and browser storage inventory.

Gotchas ​

  • The events are pushed by the chat widget (<humind-widget>). Standalone widgets on pages without the chat don't push.
  • The stream of humind_* events is additive: new events or parameters may be added over time. Never assume the list is closed: a catch-all humind_.* trigger keeps working; tags bound to specific events are unaffected.
  • Testing locally: open the browser console and inspect window.dataLayer after interacting with the chat. In GTM, use Preview mode and watch the humind_* events arrive.

Released under the proprietary Humind license.