I have a project, where we are tracking formsubmissions in 3. party tracking. We get a callback with the formID when submitted, great. But on forms in popups, I dont get the submitted values like I do on embedded forms. Are there any way to get the submitted data in the callback when form is in a CTA popup? Seems like it should be, when the form is the same regardless if it's an embed or a popup.
You're right, ideally, the submitted data should be available in the callback regardless of the form placement (embedded or popup). However, HubSpot's current functionality has limitations for popups. Here's what you can do:
1. HubSpot offers global form events that fire at different stages of the form submission process. While the deprecated onFormSubmit isn't ideal (it fires before data is sent), you can leverage the newer onBeforeFormSubmit event. This event triggers before submission but after validation, allowing you to access the form element and potentially extract data using Javascript.
You're right, ideally, the submitted data should be available in the callback regardless of the form placement (embedded or popup). However, HubSpot's current functionality has limitations for popups. Here's what you can do:
1. HubSpot offers global form events that fire at different stages of the form submission process. While the deprecated onFormSubmit isn't ideal (it fires before data is sent), you can leverage the newer onBeforeFormSubmit event. This event triggers before submission but after validation, allowing you to access the form element and potentially extract data using Javascript.
The global form events are not called on the form. I made a test, where I logged all events called in the process:
onCallToActionReady
onCallToActionViewed
onCallToActionFormSubmitted
So it seems the like only way to do it, is to add my own eventlistener on the form tag, checking for submits. Storing the data and wait for the onCallToActionFormSubmitted event, and then use the stored data.
I was just hoping for a better solution, since I am happy with the way normal forms are working.
3. I just push the info to GTM datalayer, from there others take over
The problem is that I only get the formID and id in the callback, not submitted values. If I insert the same form directly on the page, i get submitted values in the callback.
For the form in popup, I get a callback with eventname: onCallToActionFormSubmitted without submitted values
For directly embedded forms in the content, I get a callback with eventname: onFormSubmitted with submissionValues.
I would expect to get the same for both callbacks 🙂
I'd like to ask clarifying questions to better understand, please:
1. If the popup form a HubSpot form? Or an external form? 2. Where is the popup added, on an external page? On a HubSpot page? 3. How do you track the form submission? Which third-party app is it?
The more info, screenshots (without sensitive/confidential information), and details you can provide, the better the Community can assist.
I'd be happy to put you in touch with some of our Top Experts: Hi @MBERARD, @zach_threadint and @Anton do you have suggestions to help @KHarlin, please?
Thanks a lot and have a great day!
Best, Bérangère
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.