Unbounce Answers/Next Steps/Lead Management & Forms

Can I pre-populate a form with URL parameters? [VIDEO]

Oli Gardner
posted this on October 21, 2010 05:00 pm

Absolutely! If you ensure that the name of the parameter in your URL matches the name of the form field it will be inserted when the page loads. This includes visible and hidden form fields.

Try it out!

To pass values into name and company fields into your form like in the video, you could use the following query parameters:

http://unbouncepages.com/utm-tracking?name=Ryan&company=Unbounce

A popular use-case for this is when you're using google's UTM tracking...

Google has a popular URL building tool for tagging your links with useful data (which also happens automatically if your Google ADwords and Google Analytics accounts are linked). This will result in some paramaters being tacked onto the end of your Unbounce page URL which might look like this:

http:// promos.mywebsite.com/landing-page?utm_source=google&utm_medium=ppc&utm_term=landing%2Bpage%2Btemplates&utm_content=textlink&utm_campaign=template_sale

To capture this data in your form, just create a hidden field for each tag and give them the same name as the tag, so for this example you'd create the following hidden fields:

Picture_1.png

 

 

Comments

User photo
Bert Schiettecatte

very interesting, but this only works if the URL points to the landing page that holds the form. 

what if the landing page was some other page, and the visitor clicks through to the page with the form where you want to capture the utm variables? 

it seems there are ways to read the analytics cookie using javascript and store the variables in the hidden fields, and it even seems jquery has a cookie plugin that helps with this ... can you post an example for this scenario? 

August 01, 2011 01:21 am
User photo
Jens Petersen

But it doesn't work with select-fields! :(

November 28, 2011 05:59 am
User photo
James Laughlin

Good information, but it's worth saying that if you do this and open the page to look at the source you won't see the data in the hidden fields.  

You actually have to submit the form and Unbounce will pull the data out of the form and submit it.

November 30, 2011 08:40 am
User photo
Amit Vemuri

There's an issue with the pre-populated fields. It doesn't remove or convert escaped chars. Eg. if the url was

unbouncepages.com/pages/XXX/?name=sid%20mitra

the name field gets filled with "sid%20mitra", which is technically accurate but not really correct. 'Cos one would ideally want to see the %20 converted to " " or space

December 14, 2011 04:15 pm
User photo
Carter Gilchrist
Unbounce

Hey Amit, sorry for the delay getting back to you. We're going to dig in to this issue and fix it up as soon as we can, thanks for reporting it!

December 20, 2011 05:35 pm
User photo
Matalin Hatchard

I would like to echo Bert Schiettecatte's comment. would be unusual that they go directly to the contact form, normally hit the landing page and click through to my contact form. how can I pass those parameters onto the clickthough url automatically? I would see it working like this - the homepage would have links that would be standard, and a javascript code would look for url parameters. If they existed it would append them onto any link clicked through. The utm's could then be easily parsed by the contact form. can you point me in the direction of a script like that?

January 13, 2012 09:15 am
User photo
James Stinson

No update on this?

June 26, 2012 02:56 pm
User photo
Rob Schutz

Ditto to Bert and Matalin's comments - any way to automatically append the originating utm's onto outgoing links?? Would be really helpful to track the originating source all the way through the conversion funnel from my own DB.  Need to compare against purchase values, frequency, etc.

January 10, 2013 08:49 am
User photo
Ryan Engley
Unbounce

Hey guys - we've got some script that can pass the GET parameters on with click through though you've got to tweak it for your own pages.  If you send us an email to support@unbounce.com with your question and a link to your page, we can that script your way.  We base a lot of our product development on feature requests so if we hear a lot of demand for this, we may build it directly into our app.

January 10, 2013 03:25 pm
User photo
Adrien O'Leary

Hi all. Question for Carter and Ryan. Have you considered implementing - or documenting - a way to get utm parameters from the Google Analytics cookie as described at http://cutroni.com/blog/2009/03/18/updated-integrating-google-analy.... Justin Cutroni now works at Google and he has confirmed that what is described on the page respects the terms of service for Google Analytics. Thanks.

March 21, 2013 06:30 am