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:
// 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
humindkey. Before each push the widget resets it ({ humind: null }), the same pattern GA4 documents forecommerce, so parameters from a previous event never leak into the next one.
Set up GTM → GA4
- Variables: create Data Layer Variables for the parameters you care about, e.g.
humind.product_id,humind.source,humind.sentiment. - Trigger: create a Custom Event trigger. Either one per event (
humind_message_sent), or a single catch-all with "Use regex matching" and the patternhumind_.*. - Tag: create a GA4 Event tag fired by that trigger. Use the built-in
variable as the event name to forward thehumind_*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
| Event | Parameters | Fired when |
|---|---|---|
humind_launcher_shown | - | The floating chat button is first rendered on the page (once per page view). |
humind_nudge_shown | type | A proactive message bubble appears above the launcher. |
humind_nudge_clicked | type | The visitor clicks the proactive bubble. |
humind_nudge_dismissed | type | The 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
| Event | Parameters | Fired when |
|---|---|---|
humind_message_sent | source, has_product_context, has_attachments, is_first_message | The visitor sends a message. source tells you how it originated (typed, quiz, a suggested question…). |
humind_assistant_responded | answer_type, had_products | The 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_submitted | sentiment | The visitor rated an AI answer (thumbs up/down + optional details). |
Products & cart
| Event | Parameters | Fired when |
|---|---|---|
humind_product_card_shown | product_id, position | A recommended product card is displayed (once per product per message). |
humind_product_page_opened | product_id | The visitor opens a product's page from the chat. |
humind_product_url_opened | product_id | The visitor follows a product link from the chat. |
humind_product_added_to_cart | product_id, product_variant_id, price | The visitor adds a product to the cart from the chat. |
humind_product_removed_from_cart | product_id, product_variant_id, price | The visitor removes a product from the cart in the chat. |
humind_cart_opened | - | The visitor opens the cart from the chat header. |
humind_quiz_completed | quiz_id, collection_handle, answered, total_questions | The visitor finishes a product quiz that hands off to the chat. |
Human handoff & satisfaction
| Event | Parameters | Fired 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_shown | source | The satisfaction survey is displayed. source is ai (end of an AI conversation) or human (end of an operator handoff). |
humind_csat_dismissed | source | The visitor dismisses the survey without rating. |
humind_csat_submitted | rating, source | The visitor submits a satisfaction rating (1 to 5). |
humind_support_button_clicked | button, channel_type, channel_title | The 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_rated | article_id, rating | The visitor rates a help-center article. |
Leads & appointments
| Event | Parameters | Fired when |
|---|---|---|
humind_pre_chat_survey_submitted | - | The visitor submits the pre-chat contact form. |
humind_appointment_calendar_shown | type | The 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_booked | duration_minutes | The booking is confirmed. |
humind_appointment_cancelled | - | The visitor cancels a booking from the chat. |
Privacy & consent
- 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_viewandecommercepushes. 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-allhumind_.*trigger keeps working; tags bound to specific events are unaffected. - Testing locally: open the browser console and inspect
window.dataLayerafter interacting with the chat. In GTM, use Preview mode and watch thehumind_*events arrive.