company logo

Help center

Go to Userled
All collectionsConnect your stackMarketoPassing UTMs through Marketo form hidden fields

Passing UTMs through Marketo form hidden fields

Learn how to capture UTM parameters in Marketo form hidden fields when embedding forms in Userled experiences, including setup steps, testing, and tips for persisting UTMs across pages.

Passing UTM parameters through Marketo form hidden fields

When you embed a Marketo form in a Userled experience, UTM parameters from the page URL are not automatically injected into form hidden fields. However, Marketo has built-in support for capturing URL parameters; no custom JavaScript is required.

How to set it up

For each UTM parameter you want to capture, configure a hidden field in your Marketo form:

  1. Open your form in the Marketo form editor.

  2. Add hidden fields for each UTM parameter you want to track (e.g. utm_source, utm_medium, utm_campaign, utm_term, utm_content).

  3. Select a hidden field and click Edit on Autofill.

  4. Set Get Value From to URL Parameter.

  5. Enter the matching parameter name (e.g. utm_source).

  6. Optionally, set a Default Value in case the parameter is not present in the URL.

  7. Click Save.

  8. Repeat for each UTM hidden field.

  9. Approve and Close the form when done.

info icon
Tip: Disable pre-fill on UTM hidden fields so that the value is overwritten on each form submission. This ensures you capture accurate, up-to-date attribution data rather than stale values from a previous visit.

Important considerations

  • UTM parameters must be present in the page URL at the time the form loads. If a visitor lands on a page with UTMs but navigates to another page before reaching the form, the parameters will no longer be in the URL.

  • If UTMs are dropping off between pages, consider using a cookie or sessionStorage-based approach (via Google Tag Manager or a custom script) to persist UTM values across your site for the duration of the session.

  • Hidden field names don't need to match the URL parameter exactly — you define the mapping in the Autofill settings. However, using consistent naming (e.g. field name UTM Source mapped to URL parameter utm_source) makes troubleshooting easier.

Testing your setup

  1. Build a test URL with UTM parameters, e.g.:
    https://yourpage.com?utm_source=linkedin&utm_medium=paid&utm_campaign=q2_launch

  2. Open the page and submit the form.

  3. In Marketo, find the test lead and check the Activity Log to confirm the UTM field values were captured correctly.

Further reading

  • Set a Hidden Form Field Value (Adobe/Marketo documentation)

  • How to track UTM parameters in Marketo (Knak)

Did this answer your question?
😞
😐
😁