SOLVED

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

Go to solution
jengcalendly
Level 2

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

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:
https://calendly.com/landing/form

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

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

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.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

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

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

jengcalendly
Level 2

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

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

SanfordWhiteman
Level 10 - Community Moderator

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

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.

SanfordWhiteman
Level 10 - Community Moderator

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

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.