Empty lead source in your CRM: why the form drops the UTM and how to fix it
Published by the UTM Builder team at Limner.
A hidden field only arrives filled in if something puts the value there at submit time. Prefilling from the URL reads the page the form is on, so someone who landed with a UTM on page A and converted on page B arrives with no source. The fix is to store the UTMs on the first visit and fill the fields on submit, within what each CRM accepts.
Why the field arrives empty
- The person browsed before converting. The UTM was in the landing page URL, not the form page URL.
- The form sits in an iframe from another domain. For security, the browser doesn’t let a script on your page touch the fields inside it.
- The field name doesn’t match the property’s internal name in the CRM.
- The script runs before the form exists on the page and can’t find the fields.
- The form is a type that doesn’t support hidden fields.
First-visit cookie
On the landing page, if the URL has utm_*, save the values in a cookie or localStorage. On later pages, don’t overwrite them with empty values. On submit, copy the values into the hidden fields. Decide up front whether you want the first source or the last one, and use the same rule on every form. Without that decision, the same lead can show up with different sources depending on which form they filled in.
utm_source=meta | utm_medium=cpc | utm_campaign=lancamento | saved Oct 10, filled in on submit Oct 12
What each CRM documents
RD Station Marketing. In the conversion API (POST https://api.rd.services/platform/conversions, with event_type set to CONVERSION), the source goes in four fields: traffic_source, traffic_medium, traffic_campaign and traffic_value (the term). The documentation says traffic_source can be the value of the __trf.src cookie, base64-encoded or not, or the source UTM. If you send the cookie, the other three fields should be empty. If your form sends the conversion through the API without any of these fields, the source doesn’t go with it.
HubSpot. The knowledge base says the query string fills fields, hidden ones included, by the property’s internal name (Settings > Properties), and that the static query string comes from the URL of the page the form is on. A legacy form embedded on an external site sits in an iframe. The Set as raw HTML form option, in the editor’s Style & preview tab, renders the form as HTML on your page with no iframe, and requires Marketing Hub or Content Hub Professional or Enterprise. For form analytics, the HubSpot tracking code has to be on the external page.
ActiveCampaign. A hidden field is text only and only works on inline forms: it isn’t available on floating box, floating bar or modal forms. The help center suggests changing the field’s personalization tag to use an underscore (for example %UTM_CAMPAIGN%), so it matches the utm_campaign parameter in the form’s URL. For a dynamic value in the embed code, you need custom code.
Pipedrive. The August 2026 product updates page announced, for Web Forms, automatic UTM capture into hidden fields and reading cookies, such as the Google Analytics client ID, into hidden fields too. The deal’s source fields (source_origin, with the value Web forms, and source_channel) tell you how the data came in, not the campaign.
Kommo. The developer documentation says UTM fields are created with the account and appear in the Statistics section of the lead card. They’re of type tracking_data. To write them through an integration, call GET /api/v4/leads/custom_fields, take the fields of that type and send the values in custom_fields_values on POST /api/v4/leads.
How to test
- Open the site with
?utm_source=teste&utm_medium=teste&utm_campaign=teste, go to another page and submit the form from there. - Open the contact in the CRM and check each field. If it only works when you submit without browsing to another page, the cookie or localStorage storage is missing.
- Repeat with the form on every page where it appears, including pop-ups and landing pages.
Official sources
- RD Station Developers: Conversion via API key (in Portuguese)
- HubSpot: Auto-populate form fields with a query string
- HubSpot: Set up and style a legacy form on an external site
- ActiveCampaign: How do I add a hidden field to my form?
- Pipedrive: Product updates
- Pipedrive: Lead source in deals
- Kommo Developers: Lead capture (Include UTMs)