Our Webflow site integrates third-party services, so we have customers that come back from a third-party site to a certain Webflow landing page. When this happens, we want to save this event into our Webflow form submissions.
Now we have form submission data about the user, but we do not know yet, if they will complete the third-party action. This is why we will need another submission once they have returned to our site.
Our landing page for returning customers checks if there is any user data stored in localStorage, and if there is, we create a form element with hidden input fields populated with the stored values. The form behaves like a regular default Webflow form, with the redirect URL set to
# (maybe this should better be
window.location.pathname?) After creating the form and appending it to the document body, we trigger its submit function.
1.) Form submission causes a visual site reload.
2.) The redirect URL contains the form values, as we have to use GET (tried POST and got a method not allowed error from Webflow’s server).
3.) Submit has no callback, so error handling is currently missing (and might be a hack to implement).
All issues could be resolved by using AJAX to submit the form data to Webflow silently in the background, and use proper callbacks to verify if the data has been sent, so we can either delete localStorage or retry sending.
Maybe I am just overthinking the problem and looking into the wrong direction. If this can be achieved with default designer settings, that would even be better.