Passing URL Parameters Through a Form

Follow

Note

If you are concerned about GDPR compliance or Google Analytics privacy policy please refrain from appending personally identifiable information to the URL on form submissions.

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.

This article will explain how to pass URL parameters using hidden form fields, how to capture UTM values (such as traffic mediums, sources, campaigns, etc.), and how to pre-fill form fields

Passing URL Parameters using Hidden Fields

Unbounce forms pass along form data, but not URL parameters. To pass your incoming URL parameters you'll need to set up hidden fields to receive any incoming parameters:

  1. Add hidden field(s) to your form by double-clicking your existing form and clicking the Hidden Field button on the left of the Form editor
  2. Name the fields the same as your incoming parameters:hidden-fields-and-parameters.png
  3. Click Done to save the updates
  4. If you're sending traffic to another page (not your Form Configuration), check the box to Append form data to URL from the Properties Pane on the right:
    append-form-data.png
  5. Lastly, save & republish your landing page

You’re all set! All form data that passes through upon form submissions will pass along to the next destination (whether Form Confirmation or another 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, auto-tag using GCLID values. 

Take a read of Google’s documentation on best practices for tagging your URLs and our documentation highlighting some key differences between Auto-Tagging & Manual Tagging.

Whichever way you choose, you can use Hidden Fields to capture UTM or GCLID values from your Unbounce form by following these steps: 

  1. Add hidden field(s) to your form by double-clicking your existing form and clicking the Hidden Field button on the left of the Form editor
  2. These parameters can either capture UTM or GCLID values:
  3. utm-parameters-and-forms.png
  4. Leave the Default Value blank
  5. Click Done to save the updates, then save & republish your landing page.

Do note that your user must arrive at the landing page with these parameter values existing in the URL for this info to be capture in the Unbounce form. 

Testing your Parameters 

To test & see if the parameter values are capturing 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 the Builder. 

After submitting a test lead on this URL, the hidden fields in Unbounce will capture the following UTM parameter values: google, email, & fall_sale. 

These values will appear in the Leads table:

utm-parameters-and-leads-table.png

Pre-filling a Form with URL Parameters

With Unbounce, you can easily pre-fill your form fields with URL parameters (also known as query parameters).

For example, a URL parameter has two parts. A variable name and a value. In the example below, "coupon" is the variable name, and "50_2013" is the value:

http://unbouncepages.com/puravida?coupon=50_2013

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:

prefill-form-setup.png

 Screen_Shot_2013-09-13_at_4.14.01_PM.png

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. 

Helpful Resources 

Using URL Parameters: Google Auto-Tagging/Manual Tagging

Google’s Guide to URL Builders

Getting Started with Custom URLs

Benefits of Auto-Tagging (vs Manual Tagging)

Unbounce made it easy for me to find the information I need.
Strongly DisagreeDisagreeSomewhat DisagreeUndecidedSomewhat AgreeAgreeStrongly Agree

Measuring Customer Effort Score with Nicereply