-
Task
-
Resolution: Merged
-
Should have
-
None
-
1
-
Block: EN Form
-
Sprint #101, Sprint #102
Context
Hotjar is a very valuable tool for analysing our user's behaviour and we intend to expand its use across the Planet 4 community.
There's one functionality called Form Report that can capture information about each one of the form fields, allowing us to understand interactions, avg time to complete, successful and fail submissions.
Task
Although Hotjar tries to properly track when a form has been submitted successfully or not, this doesn't always work. So, we need to implement a javascript tracking code for both successful and failed submissions.
- When a form is successfully submitted, the following code should be used:
hj('formSubmitSuccessful');
Obs: There's already a dataLayer event fired when the form is submitted ('petitionSignup'). We could trigger the javascript code above in the same situations.
- When a form fails validation, the following code should be used:
hj('formSubmitFailed');
Obs: There's already a message on the frontend when the submission fails: There was a problem with the submission*.* We can trigger the javascript code above in the same situations.