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 → Tracking.

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 and price.

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_idThe visitor opens a product's page from the chat.
humind_product_url_openedproduct_idThe visitor follows a product link from the chat.
humind_product_added_to_cartproduct_id, product_variant_id, priceThe visitor adds a product to the cart from the chat.
humind_product_removed_from_cartproduct_id, product_variant_id, priceThe visitor removes a product from the cart in the chat.
humind_cart_opened-The visitor opens the cart from the chat header.
humind_quiz_completedquiz_id, collection_handle, answered, total_questionsThe visitor finishes a product quiz that hands off to the chat.

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.
  • 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 → Tracking.

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.