Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-4016

CPP - Implement Hotjar javascript tracking on form success and fail submissions

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Merged
    • Icon: Should have Should have
    • 2.2
    • 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. 

      Hotjar's documentation:

      Track Form Submissions with Javascript

            dpivo Dylan Pivo
            jmarubay Julia Marubayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: