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.
For each UTM parameter you want to capture, configure a hidden field in your Marketo form:
Open your form in the Marketo form editor.
Add hidden fields for each UTM parameter you want to track (e.g. utm_source, utm_medium, utm_campaign, utm_term, utm_content).
Select a hidden field and click Edit on Autofill.
Set Get Value From to URL Parameter.
Enter the matching parameter name (e.g. utm_source).
Optionally, set a Default Value in case the parameter is not present in the URL.
Click Save.
Repeat for each UTM hidden field.
Approve and Close the form when done.
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.
Build a test URL with UTM parameters, e.g.:https://yourpage.com?utm_source=linkedin&utm_medium=paid&utm_campaign=q2_launch
Open the page and submit the form.
In Marketo, find the test lead and check the Activity Log to confirm the UTM field values were captured correctly.