You don’t want to trigger your conversion code on the forms “Button Click” as it can and will produce false positives (e.g: user clicks button and form does not submit due to invalid data but your conversion code fires anyways).
Instead, what I suggest is using a Form Submission listener setup as follows:
[
Screen Shot 2017-04-05 at 9.38.54 AM.png921x319 9.08 KB
That will do two things:
- The trigger will fire when any hubspot form is submitted - you can change the trigger to only fire for a specific form by using the forms id=“” attribute value and modifying your trigger fires on settings.
- It will make sure that the trigger only fires if the form passes validation - (NOTE: I have seen a strange issue appearing with GTM form triggers and HubSpot forms that use inline messages instead of redirects for submit actions: “Form submission canceled because the form is not connected” - console warning with embedded forms, for now the only way to avoid that issue I have found is to not use the inline message option for the HubSpot forms)
