<?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: How to track hubspot form submissions in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089010#M41664</link>
    <description>&lt;P&gt;Thanks for your response. Still no luck&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 20:07:14 GMT</pubDate>
    <dc:creator>MShah180</dc:creator>
    <dc:date>2025-01-02T20:07:14Z</dc:date>
    <item>
      <title>How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1087017#M41643</link>
      <description>&lt;P&gt;Hi, our website is hosted on Webflow and we have hubspot forms embedded on CMS pages. Is there a way we can track these hubspot form submissions on Google tag manager?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 19:57:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1087017#M41643</guid>
      <dc:creator>MShah180</dc:creator>
      <dc:date>2024-12-24T19:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1087325#M41646</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/756155"&gt;@MShah180&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can add some JavaScript that listens for the HubSpot form submission and execute the code you would like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;script&amp;gt;
window.addEventListener('message', event =&amp;gt; {
    if (event.data.type === 'hsFormCallback' &amp;amp;&amp;amp; event.data.eventName === 'onFormSubmit') {

      // YOUR CODE HERE

    }
});
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would like to track the form submission in Google Analytics, you could use the Data Layer and the code inside would look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    'event': 'form_submission',
    'formId': 'contact_form',
    'formName': 'Contact Form'
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just make sure that Google Tag Manager is configured appropriately to record this event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 18:37:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1087325#M41646</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2024-12-26T18:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089001#M41661</link>
      <description>&lt;P&gt;I added this javascript under my form embed code but the trigger doesn't get fired on GTM. Any idea why the trigger is not firing ?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 19:47:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089001#M41661</guid>
      <dc:creator>MShah180</dc:creator>
      <dc:date>2025-01-02T19:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089002#M41662</link>
      <description>&lt;P&gt;Here is the code I pasted below the form embed code&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;window.addEventListener('message', event =&amp;gt; {&lt;BR /&gt;if (event.data.type === 'hsFormCallback' &amp;amp;&amp;amp; event.data.eventName === 'onFormSubmit') {&lt;BR /&gt;window.dataLayer = window.dataLayer || [];&lt;BR /&gt;window.dataLayer.push({&lt;BR /&gt;'event': 'form_submission',&lt;BR /&gt;'formId': 'data-form-Id', // I replace with form ID&lt;BR /&gt;'formName': 'form name' // I replace with form name&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 19:49:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089002#M41662</guid>
      <dc:creator>MShah180</dc:creator>
      <dc:date>2025-01-02T19:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089008#M41663</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/756155"&gt;@MShah180&lt;/a&gt;&amp;nbsp; could you try using 'onFormSubmitted' instead of 'onFormSubmit' and see if that works?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 19:59:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089008#M41663</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2025-01-02T19:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089010#M41664</link>
      <description>&lt;P&gt;Thanks for your response. Still no luck&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 20:07:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089010#M41664</guid>
      <dc:creator>MShah180</dc:creator>
      <dc:date>2025-01-02T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089029#M41665</link>
      <description>&lt;P&gt;Another thing to try - instead of pasting the code on your page, create a Tag (Custom HTML) in GTM and drop your &amp;lt;script&amp;gt; in there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To double check whether it is working, you can also set up a Trigger as a Custom Event and add the event name there. In my case I have it named "hubspot-form-success", you would put yours, i.e. "&lt;SPAN&gt;form_submission".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evaldas_1-1735850094925.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/135032i46541EDF8285EF44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="evaldas_1-1735850094925.png" alt="evaldas_1-1735850094925.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would see it show up in the Preview upon form submission:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="evaldas_2-1735850282302.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/135033i27F6BEE3FAC79195/image-size/medium?v=v2&amp;amp;px=400" role="button" title="evaldas_2-1735850282302.png" alt="evaldas_2-1735850282302.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 20:38:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1089029#M41665</guid>
      <dc:creator>evaldas</dc:creator>
      <dc:date>2025-01-02T20:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090792#M41690</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/756155"&gt;@MShah180&lt;/a&gt;&amp;nbsp;Are you using legacy forms or the beta form editor?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 17:41:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090792#M41690</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2025-01-07T17:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090806#M41691</link>
      <description>&lt;P&gt;I am not using legacy forms. It is form (new editor)&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 17:57:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090806#M41691</guid>
      <dc:creator>MShah180</dc:creator>
      <dc:date>2025-01-07T17:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to track hubspot form submissions</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090809#M41692</link>
      <description>&lt;P&gt;Ah. Global form events currently don't work with the new editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.hubspot.com/changelog/new-beta-form-editor-and-developer-functionality" target="_blank"&gt;https://developers.hubspot.com/changelog/new-beta-form-editor-and-developer-functionality&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to track events with GTM you'll need to use legacy forms.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 18:07:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-track-hubspot-form-submissions/m-p/1090809#M41692</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2025-01-07T18:07:40Z</dc:date>
    </item>
  </channel>
</rss>

