1. Home
  2. Forms
  3. Marketo Forms
  4. Using Hidden Fields in Marketo Forms

Using Hidden Fields in Marketo Forms

What are hidden fields?

Hidden fields are form fields which are not visible to visitors. Since visitors cannot see or enter information in hidden fields, these fields are used to gather additional information and associate it with that form submission.

Examples:
You can use hidden fields to collect:

  • The name of the Content Track on which a visitor submits the form

  • The name or URL of the content asset on which a visitor submits a form

Gathering this information is useful for understanding where the form event occurred in the Content Track!

For a full list of values that you can pass through a query string, visit our Nook article here.


How to use Hidden Fields

Here are the step-by-step instructions on how to pass information to a hidden field on a form in Marketo.

Step 1: Add Hidden Fields to Marketo Form

  1. Add the desired hidden field to your Marketo form.

    • Navigate to your form.

    • Add the field you would like to use as the hidden field to the form.
      image

  2. Change the Field Type to Hidden and edit the Autofill. Change Get Value From to URL Parameter. Add a Parameter Name of your choosing, in this example, we used track_name.
    image

  3. After completing the form, navigate to the form settings area and adjust the Thank You Page settings to redirect the form to a landing page.
    image

  4. On that desired Thank You Page, add the PathFactory Confirmation Page Capture Tag.

    • Add the following code snippet:

        id="lookbook-capture-tag" src="https://app.cdn.lookbookhq.com/libraries/capture/capture.js" data-email="{{lead.Email Address}}">


Step 2: Add the Form to PathFactory

Note
There are 2 ways to add your Marketo Form to PathFactory: using the form’s URL or its HTML.

HTML

  1. Use this URL to make a Custom HTML form in PathFactory.

    • Approve and close your form.

    • Grab the form embed code from Marketo.

      • Navigate to Form Actions.

      • Select and copy the embed code.

  2. Add the embed code to PathFactory and add the form values to be passed.

    • Add a new form with a form type of Custom HTML.

    • Paste in the Marketo form code:

        src="//app-sj01.marketo.com/js/forms2/js/forms2.min.js"> id="mktoForm_####">

    • Add the form values to be sent via hidden fields:

        src="//app-sj01.marketo.com/js/forms2/js/forms2.min.js">  id="mktoForm_XXXX"> 

      Note
      The Marketo form value, in this case experience_name, needs to match the form value that comes through the form. To see what that is, submit the form with the hidden field, navigate to the activity log for the individual who submitted the form, and see how the form field appears.

URL

  1. Once you approved and saved your form, add your form to a landing page.

    • Create a new Marketo landing page.

    • Insert a form element and select the form you just created.

    • Approve and close your landing page.

  2. Use this URL to make an External URL form in PathFactory.

  3. Manually add a query string to the end of the form’s URL. This will cause the hidden field to pick up the desired value.
    In this example we are going to capture the name of the Content Track that the form was submitted on. This would be done as follows:
    http://FORM.URL.COM/EXAMPLE.html?track_name={{experience.name}}

Warning
If you are using other query string values (for example, UTM Parameters) do not add a second question mark. Simply separate each query string value with an ampersand (&).
It doesn’t matter whether the UTM Parameters are listed before or after this hidden field query.
Example: https://FORM.URL.COM/EXAMPLE.html?track_name={{experience.name}}&utm_source=twitter&utm_campaign=spring2018

Updated on June 28, 2022

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT