I am trying to build a multi step flow that appends URL parameters when a button is clicked. That part I understand. I am struggling with, when a user is sent to a new page, I want it to keep the URL parameter from the referring page and add another parameter/value once a button is clicked on the new page.
The flow would be something like this:
- User visits url.com/page1
- User clicks button that takes them to url.com/page2/?value=1
- User clicks button that takes them to url.com/page3/?value=1&data=1
- User clicks button that takes them to url.com/page4/?value=1&data=1&num=1
As you can see in step 3 and 4 the appended parameters are remembered and continue to add on to each other, even as the user visits new pages.
Any ideas on how to solve this? Ideally with just javascript and not php, but open to suggestions.
Would a hidden form field or something like that work?
Thank you for any help!