A URL parameter is a way to pass data in a link to a web page. You can use URL parameters to track different metrics in services like Google Analytics or Google Ads, and in Unbounce to pre-fill your form.
Unbounce forms pass along data only when inputted into a form field. To pass on your incoming URL parameters, you’ll need to set up hidden fields to capture the incoming data. In this article, you will learn how to set up hidden fields in both Smart Builder and Classic Builder.
Before you get started, here are a few universal rules to keep in mind when setting up and troubleshooting your funnel:
- Hidden Field IDs must match your parameters to the letter, and are case sensitive. If there is any variation the value won’t be captured/passed through
- Visitors must arrive on the page using the URL containing your desired parameters in order to capture or prefill any data in your Unbounce form
Setting Up Hidden Fields in Smart Builder
- Add hidden field(s) to your Smart Builder form by clicking on the large box that surrounds all existing form fields.
- Click the button near the bottom left-hand corner of your form element, and select Add a hidden field from the drop-down menu.
- Name your field the same as your incoming parameters. These are case-sensitive.
- Click Submit at the bottom of the page to save your updates, and then Save and Republish your page.
Setting Up Hidden Fields in Classic Builder
- Add hidden field(s) to your Classic Builder form by double-clicking your existing form and selecting the Hidden Field option listed in the left-hand column of the form editing popup.
- Name your field(s) the same as your incoming parameters. These are case-sensitive:
- Click Done on the bottom right-hand corner of the form editing popup.
- If you’re sending traffic to another page instead of a form confirmation dialogue box, check the option to Append form data to URL from the properties panel on the right-hand side of the Classic builder:
- Save and Republish your landing page.
Capturing UTM or GCLID Values Using Hidden Fields
Tagging your URLs is a great way to pass detailed information about your campaign or traffic sources back to your Google Ads or Google Analytics account. You can use URL parameters to manually tag UTM values (utm_source, utm_medium, etc), or to auto-tag using GCLID values.
Whether you are using Smart Builder or Classic Builder, you can use Hidden Fields to capture UTM or GCLID values in your Unbounce form by following these steps:
- Add hidden field(s) according to the relevant builder instructions above.
- Name these parameters according to what you would like to capture These are case sensitive. Below are some of the most commonly used parameters:
- Leave the Default Value blank.
- Click Done in the Classic Builder or Submit in Smart Builder to save the updates.
- Save and Republish your landing page.
Testing URL Parameters
To test and see if the parameter values are being captured correctly, submit a test lead to the form while on the custom URL containing the parameters, and input some test values.
For example, suppose the URL for this custom campaign is my.amazinglandingpage.io/?utm_source=google&utm_medium=email&utm_campaign=fall_sale, and the designated hidden fields have been set up in your Unbounce form.
After submitting a test lead on this URL, the hidden fields in your Unbounce form will capture the following UTM parameter values: google, email, and fall_sale.
These values will appear in the Leads Table:
Pre-filling a Form with URL Parameters
Just like hidden fields, you can also pre-fill visible form fields using URL parameters (also known as query parameters).
For example, a URL parameter has two parts. A parameter and a value. In the example below, "coupon" is the parameter, and "50_2013" is the value:
Let's say you want to pre-fill a coupon code on your form. Using the example above, you'd want to add the "coupon" field to your form, and it would automatically pre-fill with the matching query parameter. Like so:
Pre-filling your form fields requires visible form fields. Therefore, you do not need the use of hidden fields, since the goal is to pre-fill form fields that are visible to your users.
Parameter: A key that is used to capture information about a click a visitor has made to get to another page. This can be anything that matches your Field ID or is your UTM parameter. This can be anything, so long as It matches across the board from your ad to your CRM.
Value: This is what the customer and their experience fill out within your form. This can be their name inputted in a field or a UTM Value that you preset in your Ads link.
Anatomy of a URL Parameter: landing page url?parameter=value