Known Visitor - intermittently appending an extra /page-name to the form confirmation page | Community
Skip to main content
Level 2
November 21, 2023
Solved

Known Visitor - intermittently appending an extra /page-name to the form confirmation page

  • November 21, 2023
  • 1 reply
  • 1428 views

We discovered an intermittent issue with our forms that have known visitor. When a user submits the form as a known visitor sometimes it appends an extra /confirmation-page to the end of the confirmation url thus creating a 404 error

Form for testing:
calendly.com/landing/form

Thanks in advance!

Best answer by SanfordWhiteman

Wait, you don't mean the literal values /page-name or /confirmation-page, right?

 

You mean it repeats the path of the confirmation page, whatever that is - so it should be /mythankyou but instead it's /mythankyou/mythankyou, if it’s supposed to be /otherthankyou it becomes /otherthankyou/otherthankyou, etc.


This is happening because your code has a bug that causes the visitor to be redirected

  • first to the confirmation page
  • then immediately to the confirmation page’s (nonexistent) confirmation page

This logic, packaged in this file, runs on the confirmation page as well as on the form page:

if (isKnownVisitor) {
  window.localStorage.setItem('firstName', knownFirstName);
  navigate(`thank-you?firstName=${knownFirstName}`);
} else {
  window.localStorage.setItem('firstName', values.FirstName);
  navigate(`thank-you?firstName=${values.FirstName}`);
}

 

If you look in Dev Tools » Network you can see there are two pages loaded in quick succession after a form submit. The second is the 404, /thank-you/thank-you.

1 reply

SanfordWhiteman
Level 10
November 21, 2023

Can you first check in the form settings to make sure you don’t have Advanced Thank You choices?

Level 2
November 22, 2023

Hi @sanfordwhiteman - no there are no advanced thank you settings configured. Thank you is configured as "stay on page"

SanfordWhiteman
Level 10
November 22, 2023

Wait, you don't mean the literal values /page-name or /confirmation-page, right?

 

You mean it repeats the path of the confirmation page, whatever that is - so it should be /mythankyou but instead it's /mythankyou/mythankyou, if it’s supposed to be /otherthankyou it becomes /otherthankyou/otherthankyou, etc.