Manually control fields passed as part of URL

  • 2 October 2015
  • 2 replies
  • 2 views

I would like to pass only certain form fields as part of the URL as well as some fields that are calculated outside of the form. While I see how to add all form fields, I don’t see anyway to change this option to choose what I want to pass along or augment that with non-form data.

The specific use case would be generating some unique user ID on Page A, stuffing that into a parameter string with some form element, and then picking those up on Page B to do some calculation with. 


2 replies

Hi Joseph,

You could augment it with non form data by using some script to amend the submit url where the page is going when it’s button is clicked.

window.module.lp.form.data.confirmData = “http://www.google.com”;

would become…

window.module.lp.form.data.confirmData = “http://www.google.com/?your_parameter=your_value&your_paraemeter2=your_value2”;

As for selecting which fields are passed as url parameters I don’t think you can, I think you could just pass them all, add the bits you need and when doing your calculations just ignore the extra parameters you don’t want to use and do nothing with them. 

That’s the best I can think of off the top of my head.

Cheers

Stuart.

That works. I just turn off Unbounce’s ability to push everything into a query string and I can choose what goes there (and I don’t have to push the data into hidden form fields to boot). Thanks!

Reply