The short answer is:
Yes, it is absolutely possible to track HubSpot chatflow events like chat started, message sent, and especially contact associated in GA4 using Google Tag Manager.
This is achieved by using the HubSpot Conversations API to listen for events in the chat widget on the frontend of your website, then pushing that information into the dataLayer which GTM reads.
You then create a Custom HTML Tag in GTM with the JavaScript listener code, which then fires a Custom Event trigger, and finally a GA4 event tag to send the data as a conversion, like generate_lead, to Google Analytics 4.
The long answer is:
Your frustration is completely understandable, as much of the older documentation focused on Universal Analytics, but rest assured, tracking HubSpot chat in GA4 is a common practice and is fully feasible for chatflows, not just chatbots.
The key to this solution is the HubSpot Conversations API, which exposes a set of events that fire when interactions occur within the chat widget.
The critical events you can track are conversationStarted, which is the beginning of a chat, messageSent, and contactAssociated, which is a powerful conversion event that fires when the user provides identifying information like an email or name in the chatflow, thus creating a contact in HubSpot.
The process involves placing a small piece of custom JavaScript code in a Custom HTML tag in GTM that listens for these specific HubSpot API events.
When an event fires, like conversationStarted, the code executes a command to push a custom event, such as hubspot_chat_started, into the dataLayer.
You then create a Custom Event trigger in GTM that fires on that exact dataLayer event name.
This trigger is finally linked to a GA4 event tag, where you define the event name, for example, generate_lead for the contactAssociated event, and pass any relevant details as event parameters, such as the conversation ID or a descriptive category.
While the client-side GTM setup is great for real-time tracking, an even more robust and powerful solution involves a server-side architecture using the HubSpot API, Google Analytics Data API, GTM, and a server-side environment like Stape or Google Cloud Platform.
The HubSpot API is critical here because it gives you server-to-server access to confirmed lead and contact data, including custom properties, which is far more reliable than client-side tracking, which can be affected by browser limitations or ad blockers.
You would use the client-side GTM to capture the Google Analytics Client ID (ga_session_id) and potentially the $gclid$ and send them as hidden fields or parameters to HubSpot when the chat is completed or a contact is created.
Then, using the HubSpot API and webhooks, you can send the confirmed contact creation event and their associated tracking IDs to your server-side environment on Stape or Google Cloud Platform.
This server can then use the Google Analytics Measurement Protocol, rather than the client-side tag, to send a highly accurate and rich generate_lead or purchase event to GA4.
Furthermore, you can use the Google Analytics Data API to pull reports that combine your HubSpot-confirmed lead data with GA4 session information for deeper analysis that’s impossible with client-side tracking alone.
This server-side approach is the gold standard for accuracy and future-proofing your conversion tracking.
This comment was generated with the assistance of an AI tool, incorporating my expertise in conversion tracking 