LeadConnector forms

How to track the source of your leads in LeadConnector Forms.

The form sits inside an iframe and the campaign data sits outside it. Here is how to get the two together before the lead reaches your sub-account.

Works across multiple sub-accounts Values resolved, not raw parameters Full page journey on the record
Salesforce
HubSpot
Pipedrive
Gmail
Twilio
Google Ads
Gravity Forms
Jotform
Webflow
Wix
Calendly
Typeform
The gap

The form cannot see your page

LeadConnector forms are embedded, and that is the whole problem. The form is served from a LeadConnector domain and rendered inside an iframe on your page. Everything your page knows about the visitor, the ad they clicked and the pages they read, sits outside that iframe. The form sits inside it.

So a lead lands in your sub-account with a name and a phone number. The source field is blank. The agency reporting the numbers is guessing.

Step one

Create the custom fields first

Nothing can be passed until there is somewhere to put it.

1

Open Custom Fields in your sub-account

In your sub-account, open Settings, then Custom Fields.

2

Create a Single Line field for each value

A workable minimum is Lead Source, Lead Campaign and Landing Page.

3

Note the unique key for each field

It sits under the field name and looks like contact.lead_source. That key is the address you will target.

Step two

Add the fields to the form as hidden

Open the form in the form builder. Drag in the custom fields you made. Set each one to Hidden in the field settings panel. Save and publish.

The fields now exist and are hidden. They are also empty on every submission, because nothing writes to them yet.

Running forms outside LeadConnector too?

One script covers every form on the site, whatever built it. Form tracking is the same setup for all of them.

See form tracking →
Step three

Pass the values into the iframe

The iframe cannot read the parent page, so the parent page has to hand the values over in the embed URL. LeadConnector reads query parameters on the form URL and maps them onto matching field keys.

Hardcode a value per landing page and it holds until the first organic visitor arrives. The value has to be worked out from the actual visit, not written in advance.

1

Find the iframe src in your embed code

Find the src attribute on the iframe.

2

Append your values as query parameters

Match the parameter names to the field keys you noted in step one.

3

Do it before the iframe loads

Append them before the iframe loads. After it loads is too late.

Modifying the src after load will not repopulate the fields. It will reload the form and clear anything the visitor typed.
Troubleshooting

What breaks, and why

The fields fill on a test and stay empty in production. The parameters were appended after the iframe had already loaded. Move that logic ahead of the iframe render.

The values arrive as raw parameters instead of categories. Nothing resolved them, so your reporting now carries three spellings of Google as three separate sources.

Only the last click shows up. The value was read from the current URL rather than from a held session, so someone who arrived on an ad, left, and came back through a search reads as organic.

Everything is blank on mobile. Usually a parameter stripped by a link wrapper or an in-app browser. Check what the URL actually looks like on arrival, not what you built.

With Lead Source

What Lead Source does here

Lead Source runs on your pages, outside the iframe, which is where the data actually is. It reads the referrer and campaign parameters on the first page load, resolves them to a fixed category, holds that across page changes for the whole session, and appends the resolved values to the iframe src before the form renders.

The lead reaches the sub-account with source, campaign and landing page filled in, and the full page journey on the record. For an agency running six sub-accounts, that is the difference between reporting spend and reporting which spend produced clients.

The same install covers every other form on the site, which is the wider point of form tracking.

Lead Source installs in a few minutes, and the custom fields you set up in step one are all it needs. Before changing the embed, it is worth seeing the source your forms are capturing today.

Common questions

Questions, answered.

Does this work with the LeadConnector chat widget as well as forms?

The same parameter-passing mechanism applies to any embedded LeadConnector element that accepts query parameters. Test each one, because behaviour varies by widget version.

Will this survive a form rebuild?

The custom fields will. The hidden fields on the form need re-adding if the form is rebuilt from scratch, because they are form-level configuration.

Can I do this across multiple sub-accounts?

Yes. The custom field keys need to exist in each sub-account. The parent-page script is the same.

Does this replace the built-in attribution?

It fills it. LeadConnector has attribution fields and they are frequently empty for the reason described above, which is that the data never reaches the iframe.

Track your LeadConnector leads. Free to start.

Source, campaign and landing page on every contact, across every sub-account you run.

Start free

Free to start · no card