r/FormAssembly • • Oct 16 '26

Tutorial Passing UTM Parameters from Forms to Salesforce

Your web form is eating your UTM data. Here's the fix.

UTMs live in the URL. When someone lands on your form page from a paid ad, the UTMs are right there — utm_source=google, utm_medium=cpc, utm_campaign=brand-search.

When they submit the form, those UTMs disappear. The Lead record in Salesforce has no idea which campaign, keyword, or ad drove that conversion. Your marketing team is reporting on vibes.

The fix is simple and doesn't require custom code or middleware:

1. Add UTM custom fields to your Salesforce Lead object Five fields: utm_source, utm_medium, utm_campaign, utm_content, utm_term. Text fields, takes five minutes in Salesforce setup.

2. Embed your FormAssembly form using the JavaScript snippet, not an iframe This matters , a JS embed can read the page's URL parameters. An iframe hosted on a different origin cannot.

3. Add five hidden fields to your form, one per UTM parameter

4. Set each hidden field to auto-populate from the URL query string on page load FormAssembly supports this natively. No code. The field reads the URL parameter and stores the value before the user sees anything.

5. Map the hidden fields to your Salesforce Lead fields in the Submit settings UTM values travel with the Lead record on submission.

Bonus: Add two more hidden fields for document.referrer and the full page URL. These capture attribution for organic traffic where UTMs aren't present.

After this setup, your Salesforce reports show Lead Source broken down by UTM source, campaign ROI by form submission volume, and keyword-level attribution for paid search. Worth the 30 minutes it takes to set up.

FormAssembly customers run this exact setup — WordPress-embedded FormAssembly forms, unbroken UTM-to-Salesforce pipeline, no developer involved.

Get a demo or request a trial at FormAssembly.com

1 Upvotes

1 comment sorted by

1

u/FormAssembly 26d ago

If you want to build yourself, request a FormAssembly trial here: https://www.formassembly.com/sign-up/