Forms 2.0 and Query Strings Non-Marketo Landing Pages | Community
Skip to main content
May 28, 2014
Solved

Forms 2.0 and Query Strings Non-Marketo Landing Pages

  • May 28, 2014
  • 8 replies
  • 2795 views
Hello again!

We're trying to pass a query string into our Forms 2.0...forms that are located on different non-Marketo pages.  We want to populate our Lead Source with the different areas that these are coming from so we can track what we're doing well at and what is terrible.  

We're running into an issue where we can't figure out how to populate a field using the Forms 2.0 options.  We've gotten to the point where we think we need to use a Query String to populate a hidden field which will be pushed to Sales Force, but I'm not quite sure exactly HOW to do that.  

Reccomendations?   
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Matt_Stone2
JVR: There's a "default" field that you set as well, so you can put in your value for when people arrive there organically.

Dave: The parameter name is the variable in the URL string, not the actual value. For example, if your URL is: http://www.mysite.com/?lead_source=mktSocial -- the parameter is "lead_source" and you can swap out mktSocial with whatever you want and it will be pulled into the hidden field. You just have to make sure you stay consistent with "lead_source" or it won't find the value to pull in.

8 replies

Matt_Stone2
Level 9
May 28, 2014
When you build the form in Marketo, you can add a field and set it to be hidden. Changing the field type to hidden will give you a new option called "Autofill" -- changing this will let you select a URL parameter to pull in for the value.
May 29, 2014
What if you want to have a default value in case someone arrives there organically but have the query string value override the default if someone comes in thru a campaign URL?
May 29, 2014
When you select the URL Parameter, what do you put in for the Parameter Name?  Are you supposed to put in all of the potental options for that field?  

Example: we have mktSocial mktBlog  and we want to know which one they're coming in from.  Do we list both mktSocial and mktBlog in the Parameter Name portion?  
Matt_Stone2
Matt_Stone2Accepted solution
Level 9
May 29, 2014
JVR: There's a "default" field that you set as well, so you can put in your value for when people arrive there organically.

Dave: The parameter name is the variable in the URL string, not the actual value. For example, if your URL is: http://www.mysite.com/?lead_source=mktSocial -- the parameter is "lead_source" and you can swap out mktSocial with whatever you want and it will be pulled into the hidden field. You just have to make sure you stay consistent with "lead_source" or it won't find the value to pull in.
May 29, 2014
Fantastic, Matt. Thx.  

Dave, didnt mean to hijack your thread.  It seemed like a natural followon.
May 29, 2014
Don't worry about it!  The more questions we can get answered across the board, the better for everyone.  
October 27, 2014
I'm going to hijack this thread, too.

What if I don't want this to be a "hidden" field.  I have a contact form that includes a dropdown for the Contact Reason, and I want to be able to make a selection based on the query string, if it exists, or to leave it to the customer to make a choice if there is no query string.  Is custom Javascript my answer?  Or using a second Contact Reason field and using visibility rules?
Matt_Stone2
Level 9
October 27, 2014
You should be able to achieve this via custom javascript/jQuery. Take a look at this for how to grab the parameter and this for how to add it to the drop down.

I haven't done this myself, so it might not be as simple as the above examples, but it's a place to start.