<?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: Embedded form tracking in GTM doesn't work in new form editor in Reporting &amp; Analytics</title>
    <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1151199#M7435</link>
    <description>&lt;P&gt;Hi! My bad I was OOO so I didn't catch the news on this matter...&lt;BR /&gt;If needed, I was working on a custom HTML GTM that listen the old and new Hubspot form submissions:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;var eventName = "hubspot-form-success";&lt;BR /&gt;var includeFormData = true;&lt;BR /&gt;&lt;BR /&gt;window.addEventListener("message", function(event) {&lt;BR /&gt;if (event.data &amp;amp;&amp;amp; event.data.type === "hsFormCallback" &amp;amp;&amp;amp; &lt;BR /&gt;(event.data.eventName === "onFormSubmitted")) {&lt;BR /&gt;var formData = {&lt;BR /&gt;event: eventName + "-v3",&lt;BR /&gt;"hs-form-guid": event.data.id&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;if (includeFormData &amp;amp;&amp;amp; event.data.data &amp;amp;&amp;amp; event.data.data.submissionValues) {&lt;BR /&gt;for (var field in event.data.data.submissionValues) {&lt;BR /&gt;if (event.data.data.submissionValues.hasOwnProperty(field)) {&lt;BR /&gt;var cleanedField = field.replace(/[^\w]/g, "_");&lt;BR /&gt;var key = "hs-" + cleanedField;&lt;BR /&gt;formData[key] = event.data.data.submissionValues[field];&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;window.dataLayer = window.dataLayer || [];&lt;BR /&gt;window.dataLayer.push(formData);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;window.addEventListener("hs-form-event:on-submission:success", function(event) {&lt;BR /&gt;if (typeof HubspotFormsV4 === "undefined") return;&lt;BR /&gt;&lt;BR /&gt;var form = HubspotFormsV4.getFormFromEvent(event);&lt;BR /&gt;if (!form) return;&lt;BR /&gt;&lt;BR /&gt;var formData = {&lt;BR /&gt;event: eventName + "-v4",&lt;BR /&gt;"hs-form-id": form.getFormId()&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;if (includeFormData) {&lt;BR /&gt;form.getFormFieldValues().then(function(values) {&lt;BR /&gt;if (values &amp;amp;&amp;amp; values.length) {&lt;BR /&gt;for (var i = 0; i &amp;lt; values.length; i++) {&lt;BR /&gt;var field = values[i];&lt;BR /&gt;var cleanedName = field.name.replace(/[^\w]/g, "_");&lt;BR /&gt;var key = "hs-" + cleanedName;&lt;BR /&gt;formData[key] = field.value;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;window.dataLayer.push(formData);&lt;BR /&gt;});&lt;BR /&gt;} else {&lt;BR /&gt;window.dataLayer.push(formData);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 07:44:09 GMT</pubDate>
    <dc:creator>FMaury</dc:creator>
    <dc:date>2025-05-12T07:44:09Z</dc:date>
    <item>
      <title>Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1003283#M6415</link>
      <description>&lt;P&gt;When I use the new form editor (in beta), I discovered that the form tracking in GTM doesn't work. Form submits with 'old' embedded Hubspot forms still work. I used the code that's referred to all over the internet:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script type="text/javascript"&amp;gt; 
window.addEventListener("message", function(event) { 
  console.log(event.data);
  if(event.data.type === 'hsFormCallback' &amp;amp;&amp;amp; event.data.eventName === 'onFormSubmitted') {
    
    window.dataLayer.push({ 
      'event': 'hubspot_form_success', 
      'hs-form-guid': event.data.id }); 
  } 
}); 
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already checked the Hubspot documentation but can't find changes in how to track form submits with this new editor. Does anybody have a solution for this?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 09:35:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1003283#M6415</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-07-10T09:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1003764#M6420</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/697889"&gt;@JAalbers&lt;/a&gt;&lt;/SPAN&gt;, thank you for posting in our Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears there may be compatibility issues between the new HubSpot form editor and your current GTM setup for tracking form submissions. Make sure your event listener setup (window.addEventListener) is correctly capturing the hsFormCallback event with onFormSubmitted. Check HubSpot's latest documentation for any updates on tracking form submits with the new editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help, the more information, screenshots, and details you can provide, the better I can advise on the next steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly,&lt;/P&gt;
&lt;P&gt;Pam&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 20:30:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1003764#M6420</guid>
      <dc:creator>PamCotton</dc:creator>
      <dc:date>2024-07-10T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1005672#M6421</link>
      <description>&lt;P&gt;Thank you! It listens for the hsFormCallback event with onFormSubmitted and the code fires in GTM, but it seems there is no hsFormCallback event and there's no data pushed into the dataLayer. Does the new editor perhaps use another message event?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 06:14:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1005672#M6421</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-07-11T06:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1015973#M6479</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; For people experiencing the same problem: I also reported this to the support team and I eventually received this response:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;It has been very tricky to identify and test the new form editor to capture events in GTM. - Seems like at the moment this is not supported by the new editor, and we reached out to our engineering team, and we were not given any specific expectations if this is something that they plan to implement in the future. At least not during the BETA version of form submissions.&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;In the meantime, the recommendation is to keep using the legacy form editor so you can continue keeping track and creating events for GTM.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, the &lt;STRONG&gt;conversion tracking does not work with the new editor&lt;/STRONG&gt; and will not work during the beta. I am very surprised that a company like Hubspot did not think about conversion tracking during development. The new editor works nicely, but I will certainly not use the new editor for this reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please &lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/Conversion-tracking-in-new-form-editor/idi-p/1015974" target="_blank" rel="noopener"&gt;support my idea&lt;/A&gt; to integrate this functionality in the new editor.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 07:01:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1015973#M6479</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-07-25T07:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1046309#M6681</link>
      <description>&lt;P&gt;Hi, it seems that there is no event sent at all when form is submitted, I don't have anything when i submit the form and by checking with: console.log(event.data.type)&lt;/P&gt;&lt;P&gt;I hope they will work on this for the beta because this is a huge loss...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have anything on your side?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 10:39:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1046309#M6681</guid>
      <dc:creator>FMaury</dc:creator>
      <dc:date>2024-09-26T10:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1046802#M6688</link>
      <description>&lt;P&gt;That's right, no message is sent. Currently the new form editor (beta) is still a very stripped down version. Our contact told us there are also some other issues with the beta at the moment and I would not use it in pages except for testing.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 05:59:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1046802#M6688</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-09-27T05:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1057625#M6760</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/697889"&gt;@JAalbers&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/60427"&gt;@PamCotton&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;We are looking to roll out these forms for a couple of clients, and I'm wondering if there have been any updates on tracking capabilities since the latest updates, please?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 01:53:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1057625#M6760</guid>
      <dc:creator>MeikaB</dc:creator>
      <dc:date>2024-10-21T01:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1058281#M6769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/99604"&gt;@MeikaB&lt;/a&gt;&amp;nbsp;, I heard&amp;nbsp;that the product team is actively working on this now. It should be rolled out by the end of the year.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 06:09:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1058281#M6769</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-10-22T06:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1079094#M6978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/697889"&gt;@JAalbers&lt;/a&gt;, I just wanted to check to see if you have heard anything about the new form editor working with GTM now that it's December/almost the end of the year.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 17:43:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1079094#M6978</guid>
      <dc:creator>SilasFindley</dc:creator>
      <dc:date>2024-12-04T17:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1079365#M6988</link>
      <description>&lt;P&gt;Unfortunately no!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 08:10:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1079365#M6988</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2024-12-05T08:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1090368#M7068</link>
      <description>&lt;P&gt;Are there any updates on this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 21:30:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1090368#M7068</guid>
      <dc:creator>Cnadler</dc:creator>
      <dc:date>2025-01-06T21:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1120705#M7269</link>
      <description>&lt;P&gt;March 11st 2025 / It looks like there is still no solution &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;Does someone found one?&lt;BR /&gt;It's crazy that we cannot track form submission with GTM with the new hubspot form editor, can't understand how, it's so important for all companies like mine...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 10:35:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1120705#M7269</guid>
      <dc:creator>GCampus</dc:creator>
      <dc:date>2025-03-11T10:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138984#M7371</link>
      <description>&lt;P&gt;Thanks for letting us know, I just wasted 6 hours trying to use old setup with the new form, I would prolly spent another 5 if not for your post.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 12:49:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138984#M7371</guid>
      <dc:creator>Chris_Bronc</dc:creator>
      <dc:date>2025-04-22T12:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138987#M7372</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I've been working with a colleague on a new version of the listener and everything seems to work so far!&lt;BR /&gt;We are making the last modifications but I can keep you updated when everything will be accessible so you can try on your side if you want?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 12:53:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138987#M7372</guid>
      <dc:creator>FMaury</dc:creator>
      <dc:date>2025-04-22T12:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138992#M7373</link>
      <description>&lt;P&gt;I would love that. Please keep us updated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 12:58:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1138992#M7373</guid>
      <dc:creator>Chris_Bronc</dc:creator>
      <dc:date>2025-04-22T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1139040#M7374</link>
      <description>&lt;P&gt;Wow, great! Please share if you're ready.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 13:54:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1139040#M7374</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2025-04-22T13:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1142387#M7396</link>
      <description>&lt;P&gt;Hi all, HubSpot employee here! &lt;BR /&gt;&lt;BR /&gt;I've researched internally, and our team suggests that&amp;nbsp;&lt;SPAN&gt;the new form editor (i.e., Forms 2.0) uses a different event name. Kindly refer to the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.hubspot.com/docs/guides/api/marketing/forms/global-form-events" rel="nofollow" target="_blank"&gt;New Form Global Events&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;doc to set up form events with GTM. For anything dev- or troubleshooting-related to this topic,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;it would be best to consult&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" title="HubSpot Developer Support" href="https://community.hubspot.com/t5/HubSpot-Developer-Support/ct-p/developers" target="_blank" rel="nofollow noopener noreferrer"&gt;HubSpot Developer Support&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;or the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" title="Developer Community" href="https://developers.hubspot.com/docs/getting-started/slack/developer-slack" target="_blank" rel="nofollow noopener noreferrer"&gt;Developer Community&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV data-cv-message-history-id="756fc3bf739344bcb19feea8b306ac20"&gt;
&lt;DIV&gt;
&lt;DIV class="SpacingWrapper-sc-1xidejt-0 eUMQGi" data-test-id="spacing-wrapper"&gt;
&lt;DIV class="PrimaryMessage__PrimaryMessageWrapper-klssag-0 hntKOq" data-test-id="primary-message-visitor" data-debug-common-message-mismatch="true"&gt;
&lt;DIV class="PrimaryMessageContent__PrimaryMessageContentWrapper-sc-1a52rq6-0 cONIeg" data-test-id="primary-message-content-wrapper"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Apr 2025 20:53:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1142387#M7396</guid>
      <dc:creator>RobertColson</dc:creator>
      <dc:date>2025-04-29T20:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144375#M7404</link>
      <description>&lt;P&gt;Hi !&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not an expert but I've done some tests with what you've provided and I couldn't get it to work on Google tag manager? Has anyone succeeded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script type="text/javascript"&amp;gt; 
window.addEventListener("hs-form-event:on-submission:success", function(event) { 
  console.log(event.data); {
    
    window.dataLayer.push({ 
      'event': 'hs-form-event:on-submission:success', 
      'hs-form-guid': event.data.id }); 
  } 
}); 
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Have a nice day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 13:05:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144375#M7404</guid>
      <dc:creator>G_Pereira</dc:creator>
      <dc:date>2025-05-05T13:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144929#M7407</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi! I noticed two issues in your code:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;- The correct event property is event.detail, not event.data. HubSpot uses the standard CustomEvent object, and the data is stored under .detail.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- You’re opening a block (with a curly bracket) directly after console.log(event.data); without a closing bracket — that’s a syntax error. Solution: remove the unnecessary curly bracket.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;I’ve tested the new global events that &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/157065"&gt;@RobertColson&lt;/a&gt;&amp;nbsp;&amp;nbsp;suggested — they work great!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;You can use the following code in your Custom HTML tag and trigger it on DOM ready to ensure all relevant events are captured:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script&amp;gt;
(function() {
function pushToDataLayer(eventName, event) {
window.dataLayer = window.dataLayer || [];

var formId = event.detail.formId;
var instanceId = event.detail.instanceId;

var data = {
event: eventName,
formId: formId,
instanceId: instanceId
};

dataLayer.push(data);
}

window.addEventListener('hs-form-event:on-submission:success', function(event) {
pushToDataLayer('form_submit_success', event);
});

window.addEventListener('hs-form-event:on-submission:failed', function(event) {
pushToDataLayer('form_submit_failed', event);
});

window.addEventListener('hs-form-event:on-interaction:navigate:next', function(event) {
pushToDataLayer('form_navigate_next', event);
});

window.addEventListener('hs-form-event:on-interaction:navigate:previous', function(event) {
pushToDataLayer('form_navigate_previous', event);
});
})();
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 11:27:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144929#M7407</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2025-05-06T11:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded form tracking in GTM doesn't work in new form editor</title>
      <link>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144932#M7408</link>
      <description>&lt;P&gt;Additionally, I think it's best to only fire this code on pages that contain a HubSpot form. You can do that by creating a custom JavaScript variable with the following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;function() {
  if ( document.querySelector('script[src*="hsforms.net"]') ) {
    return true;
  } else {
    return false;
  } 
}&lt;/LI-CODE&gt;&lt;P&gt;Then, you can modify the trigger so that it only fires when this variable returns true.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 11:33:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Reporting-Analytics/Embedded-form-tracking-in-GTM-doesn-t-work-in-new-form-editor/m-p/1144932#M7408</guid>
      <dc:creator>JAalbers</dc:creator>
      <dc:date>2025-05-06T11:33:09Z</dc:date>
    </item>
  </channel>
</rss>

