Form submission success in Javascript object

We are working on a request to enhance GoogleTagManager/GA4 on our site. We have created a window object via Javascript and then push user behavior data to that object. For example, when the user clicks a button we push data that there was a button click event and what they clicked.

Part of the request that we have struggled to add is that we would like to capture when a form has successfully submitted. We don’t see anything in the Gravity Forms developer docs about a Javascript hook that we can use and our attempts at localizing the PHP hooks have not worked. We use redirects for all of the form confirmations so using hook like ‘gform_after_submission’ fail because the data isn’t exposed to the frontend before redirecting.

Summing up, once a form passes validation we need to push “form_submit_success” to a window object via Javascript.

Any suggestion on how we can accomplish this?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.