Re: One basic form on multiple pages

Anonymous
Not applicable

One basic form on multiple pages

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).
Tags (1)
7 REPLIES 7
Josh_Hill13
Level 10 - Champion Alumni

Re: One basic form on multiple pages

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.
Anonymous
Not applicable

Re: One basic form on multiple pages

So, I can't base the hidden fields off the page URL alone, I have to use URL params?
SanfordWhiteman
Level 10 - Community Moderator

Re: One basic form on multiple pages

@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.
 
Anonymous
Not applicable

Re: One basic form on multiple pages

@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 - Community Moderator

Re: One basic form on multiple pages

@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 - Community Moderator

Re: One basic form on multiple pages

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 
        })
    });
Anonymous
Not applicable

Re: One basic form on multiple pages

@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.