On this page
What this issue is
Most CRMs and form tools store a lead source on each contact: the channel or campaign that brought the person in. The problem is that the field is often a plain text field fed by hidden form fields. Every new form submission writes to it again.
So a person who first came from a Google Ads click, then returns a week later by typing your address, can end up with 'direct' as their source. The original campaign is lost. This is a mapping and field-update problem, not a tracking-tag problem.
Why it costs you leads or sales
Reports start crediting the wrong channels. Paid campaigns that opened the relationship look weak, while direct, email and branded search look strong. You may cut budget from the channel that actually starts your best customers.
It also hurts sales follow-up. A rep who sees 'newsletter' as the source will not know the person first came from a specific ad or guide.
- Visit 1: ad clickutm_source=google, utm_medium=cpc
- Form submittedSource saved as google / cpc
- Visit 2: directNo UTMs in the URL
- Second form submittedHidden field sends 'direct' and updates the contact
- ReportsAd credit is gone
The first visit is recorded correctly; the second submission overwrites it.
Example: the same 100 customers, credited by the overwritten field and by a preserved first-touch field.
How to check if your site has it
Submit a form with UTMs
Open your form page with ?utm_source=test1&utm_medium=cpc&utm_campaign=first and submit it with a test email you control.
Note the stored values
Open the contact in your CRM and write down the source, UTM and original source fields.
Return without UTMs
Use a new tab or a private window, open the same page with no parameters and submit again with the same email.
Compare
If the source or UTM fields now show direct, empty or the new value, they are being overwritten. Check the property history if your CRM offers it.
How to fix it
The principle is the same everywhere: keep first-touch fields (set once, never overwritten) separate from last-touch fields (updated on every submission).
Split the hidden fields
In your form plugin, add separate hidden fields such as first_utm_source and last_utm_source. The exact setup depends on the plugin.
Fill first-touch only once
Use the script below so first-touch values are stored in a cookie or local storage on the first visit and never replaced.
Map to separate CRM fields
In the form's CRM integration, send first_* to the first-touch contact properties and last_* to the last-touch ones.
Create first-touch storage
Add a Custom HTML tag on All Pages that runs the script below. It saves UTMs only if no first-touch value exists.
Read the values
Create 1st-party cookie variables for fg_first_source and fg_last_source.
Pass them to the form
Fill the matching hidden fields from those variables with a tag that fires on form load.
Use separate custom fields
Create custom fields for first and last touch UTMs under Settings > Custom Fields.
Add hidden fields to the form
Add hidden fields in the form or survey builder and fill them from the script below.
Avoid overwriting in workflows
If a workflow updates the contact, add a condition so first-touch fields are only set when they are empty.
Store on first visit
Run the script below on every page so first-touch values are written once.
Submit both sets
Include first_* and last_* values in your form payload.
Do not overwrite on the server
In your API call or database update, set first_* only when the stored value is empty.
(function () {
var params = new URLSearchParams(window.location.search);
var keys = ['utm_source', 'utm_medium', 'utm_campaign'];
function get(name) {
var m = document.cookie.match('(?:^|; )' + name + '=([^;]*)');
return m ? decodeURIComponent(m[1]) : '';
}
function set(name, value) {
document.cookie = name + '=' + encodeURIComponent(value) + '; path=/; max-age=' + 60 * 60 * 24 * 90 + '; SameSite=Lax';
}
keys.forEach(function (k) {
var v = params.get(k);
if (v) {
if (!get('fg_first_' + k)) set('fg_first_' + k, v);
set('fg_last_' + k, v);
}
});
if (!get('fg_first_utm_source') && !params.get('utm_source')) {
set('fg_first_utm_source', document.referrer ? new URL(document.referrer).hostname : 'direct');
}
})();For HubSpot, Salesforce and similar CRMs, check the field settings and form or workflow options for a rule such as 'only update if empty' or 'do not overwrite'. Menu names differ by product, so look in your CRM's property or field settings.
Single source field
- Source: direct
- Campaign: empty
- Original ad lost
First and last touch fields
- First source: google / cpc / first
- Last source: direct
- Both journeys visible
Overwrites on
Leads or data lost
The second submission replaces google / cpc with 'direct'. The original campaign disappears from reports.
Toggle to see what the contact record keeps after a returning visit.
How to confirm it's fixed
- Submit a test lead with UTMs and confirm first and last fields match.
- Submit again with no UTMs using the same email.
- First-touch fields still show the original values.
- Last-touch fields show the newest visit.
- Property history shows no change to first-touch fields.
- Repeat the test on mobile and in a private window.
How to prevent it happening again
- Name fields clearly: first_* and last_*.
- Document which field each form and workflow writes to.
- Set first-touch fields to update only when empty.
- Re-run the two-visit test after changing forms, CRM mappings or workflows.
- Review integrations that sync contacts, as they can overwrite fields too.
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. It depends on how your CRM stores field history across many visits by the same person, which a scheduled robot journey does not see. A CRM audit, a data-quality report or a field-history review inside your CRM is the kind of tool that fits.
FunnelGuard can still help around it. It runs your real lead form on a schedule, checks that the tracking hits fire and that test leads reach your inbox and CRM. Free plan: 1 site, 2 journeys, daily checks, no card.
Questions people ask
Why does my lead source change to direct after a second visit?
A returning visitor often has no UTMs in the URL. If a hidden field sends 'direct' or an empty value and your CRM updates the contact on every submission, it replaces the original source. Store first-touch values separately and do not overwrite them.
What is the difference between first-touch and last-touch source?
First-touch is the channel that brought the person to your site the first time. Last-touch is the channel of the most recent visit or submission. Keeping both gives you a fuller picture of the journey.
How do I stop my CRM from overwriting the lead source?
Use a field that is set only when empty, or send new values to a separate last-touch field. Check your CRM's field and form settings for an option such as 'do not overwrite existing value'. The wording varies by product.
How do I test whether my lead source gets overwritten?
Submit a form with UTMs using a test email, then submit again with the same email and no UTMs. Open the contact and compare the source fields. If they changed, they are being overwritten.
Can I fix an overwritten lead source for existing contacts?
Only if the original value was stored somewhere else, such as property history, a first-touch field or an ad platform export. If it was not, the data cannot be recovered, so fix the setup for new contacts.
Does FunnelGuard detect overwritten lead sources?
No. This needs a CRM data-quality or field-history review. FunnelGuard checks that forms work, tracking hits fire and test leads arrive in your inbox and CRM.
Do I need cookie consent to store first-touch UTMs?
It depends on your region and how you store them. Cookies used for marketing attribution often need consent under EU rules. Check your consent setup and legal advice before storing them.
Related issues
- TRK-270UTMs not written to CRM contact fieldsFix guide
- TRK-278Hidden UTM fields present but emptyFix guide
- TRK-279Hidden fields populated with literal placeholders ({utm_source})Fix guide
- TRK-280First-touch vs last-touch UTM fields swappedFix guide
- TRK-269HubSpot original source shows 'Offline' for web leadsFix guide
- TRK-272GoHighLevel attribution source missing on contactFix guide