When multi-page forms submission are accounted as abandoned

There is a specific implementation of the multi-page forms I saw around where the form is not submitted. Instead, it simply displays a “Thank you” message – without a redirect submit action.

To illustrate what I am saying, here is an example:

Sample multi-page form with a thank you message as last navigation step

Notice that the “send message” button has the Navigation step property configured as Next and the last page is a “Thanks for submitting your form” message. The “send message” button also has the Save Data and a custom submit action named “Identify Contact”, but it does not contain a “Redirect”.

In ordinary implementation, the last step of the multi-page form would be a submit button configured with Navigation step set to “Submit” and a “Redirect” submit action. Here is an illustration:

Sample multi-page form with a submit button and redirect to page action

Going back to the sample form. When it is submitted, the data is successfully persisted on the Experience Forms databases. However, when the session ends, you will notice that the submission is computed as “abandoned form”.

Abandonment rate in the performance tab when you select a form

Why is that?

Sitecore only registers the form as submitted when there is a submit button with Navigation step set to “Submit”. This behavior is hard coded in the method ProcessFormData located in Sitecore.ExperienceForms.Mvc.Controllers.BaseFormBuilderController, Sitecore.ExperienceForms.Mvc.

Decompiled code showing logic behind tracking the form submission

On top of that, when session ends, that form is computed as “drop out form” (this is the technical term) in the patch Sitecore.ExperienceForms.Analytics.Pipelines.SessionEnd.RegisterFormDropouts, Sitecore.ExperienceForms.Analytics.

What has Sitecore support said?

This behavior is expected. The form won’t be considered as ‘abandonment’ only in case the form is submitted. However, when the ‘Navigation step’ field is set to the ‘Next’ value, this just makes the button perform the ‘Next’ action not submitting the form, regardless of having any of the submit action. Thus, the form is never submitted and after waiting for session timeout it is considered as ‘abandonment’.

Please, consider using the ‘Submit’ value in the ‘Navigation step’ field to avoid considering the form as an ‘abandonment’ after the session expiration. Also, you could place the ‘Thank you page’ at the separate Sitecore item and use the ‘Redirect to Page’ submit action to navigate to it.

So, what now?

I would recommend you sticking to the simplest solution. Follow what Sitecore support has said.

Now, if you want to keep using the “thank-you-step” approach without submitting the form, then consider examining the code I mentioned and tweaking Sitecore Forms a little bit. I don’t encourage you following this way as there are many unknowns around the side-effects of playing with the form tracking code, but if you are feeling lucky, here are some suggestions:

  • You can try creating a “Register Form Event” submit action.
  • You can patch a processor to the forms.executeSubmit pipeline and reuse the same logic from the method ProcessFormData located in Sitecore.ExperienceForms.Mvc.Controllers.BaseFormBuilderController, Sitecore.ExperienceForms.Mvc.

Please kindly share it the results with the community afterwards.

Credits

Photo by Ben Cliff on Unsplash

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s