The short answer is:
The best approach to accurately track the advanced HubSpot Chat interactions like “Email Submitted through chat” and “Meeting Booked through chat” is to move beyond client-side JavaScript listeners and implement server-side tracking.
This involves configuring HubSpot to send real-time event data directly to a server environment, such as a container in Google Tag Manager Server-Side (hosted on Stape or Google Cloud Platform), which then forwards the clean, enriched data to GA4 using the Measurement Protocol.
This method is superior because it captures events reliably and can incorporate server-side data, ensuring complete and accurate attribution for your GA4 events like generate_lead and schedule.
The long answer is:
Your challenge in moving from a platform like Qualified, which may have had more direct GTM integration options, to HubSpot Chat is common.
While basic “Chat Started” events can often be tracked client-side using JavaScript listeners that observe the HubSpot chat iframe or local storage changes, capturing the more complex and valuable conversions like “Email Submitted through chat” and “Meeting Booked through chat” reliably with client-side code becomes very difficult.
These advanced conversions often happen inside an iframe or involve multi-step processes that client-side listeners can easily miss, leading to under-reporting in GA4.
The listeners you’ve found for “Chat starts” are a good start, but they won’t reliably capture the form submission or meeting booking within the chat window.
A much more robust and future-proof solution is to utilize the HubSpot API in conjunction with a server-side tagging environment (GTM Server-Side, hosted on Stape or Google Cloud Platform).
HubSpot is excellent at knowing exactly when a lead submits an email or books a meeting.
You can configure a HubSpot Workflow or use webhooks to fire a notification to your GTM Server-Side container immediately upon the completion of the Email Submitted or Meeting Booked event.
This notification would include a unique user identifier, such as a Client ID or User ID, which you would need to capture when the chat starts and pass into HubSpot.
The server-side container then receives the event, enriches it with the necessary user context and potentially even campaign data pulled via the Google Analytics Data API for historical context, and then sends a precise event payload to GA4 via the Measurement Protocol.
For “Email Submitted through chat,” you should use the GA4 standard event generate_lead.
For “Meeting Booked through chat,” you should use a custom name or the standard event schedule.
This server-side approach eliminates dependence on the user’s browser, ad blockers, or the complexity of the HubSpot iframe, ensuring you capture every critical conversion event accurately in GA4.
This comment was generated with the assistance of an AI tool, incorporating my expertise in conversion tracking 