Add Variables to Redirect URL
This article will show you how to add URL Variables to a URL on re-direct so you can pass any field or response from your form to another page.
Important note: If you need to pass data into a CRM, then check out our documentation around our available integrations.
Follow the steps below to append variables to your redirect URL:
Step 1: Identify which fields to append to your URL
In most cases you'll probably need to append an email address and name at the very least. But it's worth noting that with GetLeadForms you can append any field and response. To start, simply make a quick list of what fields and responses you need to append.
Step 2: Add your redirect URL to your Lead form
Go to the step that you're looking to redirect, in this case it's the contact form step of this demo form and add a redirect URL.
Step 3: Add your parameters to your URL
Let's say that you're redirecting your prospects to a URL like:
https://domain.com/thank-you/
To pass a variable into the thank you page URL, you'll need to structure the URL like this:
https://domain.com/thank-you/?paramater={field_name}
For example, if you'd like to pass over an email, then the URL could be structured like this:
https://domain.com/thank-you/?email={field_name}
In this case you're simply replacing the {field_name} with whatever the field name for your email is in your form.
For this example, let's pass over two fields and a response.
Adding fields to your URL
Let's add the email address and name to the URL.
To find the field name, simply go to the field in your form and copy the variable name as highlighted in the screenshot below:
In this case for the email address it's:
{contact_form__email}
For first name:
{name__name}
Important: In your case, your field name will likely be something different and it can even be custom set. So please do not copy the field name above. Instead, plesae copy the field names from your form.
Now take the field names that you just copied and add them to your URL so it's structured like this:
https://domain.com/thank-you/?email={contact_form__email}&name={name__name}
- Add the field names with the brackets { }
- Chain field names together by placing an & sign between
Inside of your Lead Form it might look something like this:
Adding response values to your URL
In addition to capturing fields like email, name, and phone, you can also capture responses.
For example, imagine that we wanted to capture the response from this service type step:
In this case, we don't know what response the prospect is going to select. So simply copy the Step Variable name in the upper right hand corner of the screen and add that to the URL.
In my case it's:
{service_type}
Combining it to to the name and email fields in our example URL, it would look something like:
https://domain.com/thank-you/?email={contact_form__email}&name={name__name}&service={service_type}
With the way this URL is structured, the following will be added to the URL on redirect after the form is submitted:
- Email address
- Name
- Service type response
You have full control to append any field or data point from your lead form to your URL. If you have any questions or run into any issues please reach out to support@getleadforms.com