New Forms dont Push Frm Submit to the Data Layer

Hey! Yeah, the newer HubSpot forms (especially the ones embedded via the HubSpot Forms API or using newer iframes) don’t trigger the same events as legacy forms, so it makes sense that your old tracking setup isn’t working the same way.

To track form submissions, you’ll need to listen for the message event that HubSpot sends from the iframe when a form is submitted. Here’s a basic example of JavaScript you can use to capture that event:

window.addEventListener("message", function(event) {
 // Make sure it's coming from HubSpot
 if (event.data && event.data.type === "hsFormCallback" && event.data.eventName === "onFormSubmit") {
 console.log("HubSpot form submitted");

 // You can trigger any other tracking logic here
 // For example, pushing to GTM or Google Analytics
 // dataLayer.push({ event: "hubspotFormSubmit" });
 }
});

You can drop this script on the page where your embedded form lives. Just make sure your form is embedded using HubSpot’s standard embed code (not as raw HTML), since this message event comes from the iframe.

Let me know if you’re trying to do something specific with the submission; like fire a GA4 event or trigger something in GTM.