<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tracking Hubspot chat on GA4 with Google Tag Manager in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/826760#M35196</link>
    <description>&lt;P&gt;That is outstanding, I tried to implement JS cod for GTM to track leads from Hubspot chat, didn't succeed. HS technical support was out of help, like "sorry, we can't help you to track leads" &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 15:36:00 GMT</pubDate>
    <dc:creator>Nick9</dc:creator>
    <dc:date>2023-07-28T15:36:00Z</dc:date>
    <item>
      <title>Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/806031#M34615</link>
      <description>&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;I am writing to ask you about the feasibility of tracking Hubspot chat in GA4 using Google Tag Manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to track certain events in GA4 such as message sent, chat closed or chat started? I have seen some tutorials on the web but they are only for the old Universal Analytics, I have not seen anything on GA4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I stress that I would need to track events for a chatflow, not for a chatbot.&lt;/P&gt;&lt;P&gt;Many thanks in advance to anyone who can help me.&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 13:40:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/806031#M34615</guid>
      <dc:creator>AStefanini</dc:creator>
      <dc:date>2023-06-12T13:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/806951#M34621</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/479175"&gt;@AStefanini&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your question. I'd like to invite some community members to the conversation – hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/66301"&gt;@Bryantworks&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/92197"&gt;@albertsg&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/20261"&gt;@louischausse&lt;/a&gt;, have you had any experience or success with this recently?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 21:51:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/806951#M34621</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-06-13T21:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/819982#M35020</link>
      <description>&lt;P&gt;Was this ever solved? I'm facing exactly the same challenge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 12:01:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/819982#M35020</guid>
      <dc:creator>MJackson38</dc:creator>
      <dc:date>2023-07-14T12:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/820100#M35024</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/599014"&gt;@MJackson38&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I have not yet found a solution to the question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I have not received a reply, I think it is not yet possible to integrate the data from the chat on GA4.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:40:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/820100#M35024</guid>
      <dc:creator>AStefanini</dc:creator>
      <dc:date>2023-07-14T15:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/826760#M35196</link>
      <description>&lt;P&gt;That is outstanding, I tried to implement JS cod for GTM to track leads from Hubspot chat, didn't succeed. HS technical support was out of help, like "sorry, we can't help you to track leads" &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:36:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/826760#M35196</guid>
      <dc:creator>Nick9</dc:creator>
      <dc:date>2023-07-28T15:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/828883#M35262</link>
      <description>&lt;P&gt;I followed &lt;A href="https://thedigitalmetric.com/how-to-track-hubspot-live-chats-via-google-tag-manager/" target="_blank" rel="noopener"&gt;this GA4 setup guide&lt;/A&gt; and it works well for tracking the start of a conversation. But doesn't work for the contact association portion. I'm still trying to get that to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 18:22:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/828883#M35262</guid>
      <dc:creator>SC-seu</dc:creator>
      <dc:date>2023-08-02T18:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Tracking Hubspot chat on GA4 with Google Tag Manager</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/1207869#M44237</link>
      <description>&lt;P&gt;The short answer is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;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.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;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.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;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.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The long answer is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The critical events you can track are &lt;EM&gt;conversationStarted&lt;/EM&gt;, which is the beginning of a chat, &lt;EM&gt;messageSent&lt;/EM&gt;, and &lt;EM&gt;contactAssociated&lt;/EM&gt;, 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When an event fires, like &lt;EM&gt;conversationStarted&lt;/EM&gt;, the code executes a command to push a custom event, such as &lt;EM&gt;hubspot_chat_started&lt;/EM&gt;, into the dataLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You then create a Custom Event trigger in GTM that fires on that exact dataLayer event name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This trigger is finally linked to a GA4 &lt;EM&gt;event&lt;/EM&gt; tag, where you define the event name, for example, &lt;EM&gt;generate_lead&lt;/EM&gt; for the &lt;EM&gt;contactAssociated&lt;/EM&gt; event, and pass any relevant details as event parameters, such as the conversation ID or a descriptive category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would use the client-side GTM to capture the Google Analytics Client ID (&lt;EM&gt;ga_session_id&lt;/EM&gt;) and potentially the $gclid$ and send them as hidden fields or parameters to HubSpot when the chat is completed or a contact is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This server can then use the Google Analytics Measurement Protocol, rather than the client-side tag, to send a highly accurate and rich &lt;EM&gt;generate_lead&lt;/EM&gt; or &lt;EM&gt;purchase&lt;/EM&gt; event to GA4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This server-side approach is the gold standard for accuracy and future-proofing your conversion tracking.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;This comment was generated with the assistance of an AI tool, incorporating my expertise in conversion tracking &lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 15:27:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Tracking-Hubspot-chat-on-GA4-with-Google-Tag-Manager/m-p/1207869#M44237</guid>
      <dc:creator>Sweely</dc:creator>
      <dc:date>2025-10-03T15:27:11Z</dc:date>
    </item>
  </channel>
</rss>

