Skip to main content
February 26, 2015
Question

One basic form on multiple pages

  • February 26, 2015
  • 7 replies
  • 2004 views
My Marketo experience is limited, so I'll apologize in advance. We have over 100 forms on our website, all using the same fields. Each form has a 3 hidden fields that get pushed up to Salesforce to let our Marketing and Sales teams know what the prospect wanted, so we know how to follow up. Right now we are using a PHP combined with a database to accomplish this. I would love to build one form in Marketo and then populate those hidden fields based on the URL. The forms will be added to the web pages via javascript (or iframe if that is easier).
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

7 replies

Josh_Hill13
Level 10
February 26, 2015
Yes, you can do this. I recommend the embed code for Marketo forms.

Just create a form and add the three hidden fields to populate from URL params and identify those params in the Form editor.

Then make sure your URLs are formatted properly. You may need to add special cookies/javascript in case your leads wander off the landing page, only to return later. If they do this, you will lose the url params.

And I should mention that in Marketo, create ONE form in Design Studio. Then place it on ANY page you want.

BUT, your smart campaigns should use Fills Out Form IS Form X on Page Y to ensure the right triggers happen.
February 26, 2015
So, I can't base the hidden fields off the page URL alone, I have to use URL params?
SanfordWhiteman
Level 10
February 27, 2015
@Michael C do you mean you use RESTful URLs like http://www.example.com/user/michael/documents/images/123?

If so you will have to parse the values out yourself.  URLs like that need to be customized specifically for your web site, since they don't follow the more standard ?field1=value1&field2=value2 format.

After you parse the values out of the URL you can set the form values accordingly.  A Marketo form has a regular HTML <FORM> under the hood.
 
February 27, 2015
@Sanford W No, I was wondering if I could use the actual page URL http://www.domain.com/page1 to populate the hidden fields.
SanfordWhiteman
Level 10
February 27, 2015
@Michael C Do you want the full URL to become one of your fields?

That is, the Lead's `Last_filled_out_form_on_page`  field gets set to "http://www.example.com/page1"?

The page on which a user fills out a form is already usable in triggers (as @Josh mentioned).  If you wanted to save it to the Lead record, you could def'ly do it with a hidden field, but you would have to read it out of the URL and set the value yourself when the form loads.
SanfordWhiteman
Level 10
February 27, 2015
Like so:

MktoForms2.loadForm("//app-zz01.marketo.com", "AAA-BBB-CCC", 96,
    function(form) {
        form.addHiddenFields({
            'Last_filled_out_form_on_page' : document.location.href 
        })
    });
February 27, 2015
@Sanford W No. I want to populate the hidden fields depending on what the URL is. The hidden fields set the business line, the product line and the product.