On this page
What this issue is
When a visitor submits a form, your site emails the owner or sales team. That email should say where the visitor came from. A UTM is a tag added to a link, such as utm_source=google or utm_campaign=spring, that names the channel and campaign. A click ID such as gclid (Google Ads) or fbclid (Meta) does a similar job for ad platforms.
Why it costs you leads or sales
The lead is not lost, but its origin is. Sales cannot prioritise leads from high-intent channels. Marketing cannot match leads to spend, so budget decisions rely on guesses. Offline conversion uploads to Google Ads or Meta need a click ID, and without it you cannot send them.
- Ad clickURL has utm_source and gclid
- Landing pageVisitor reads the page
- Form submitNo hidden UTM fields to store the data
- Notification emailName, email, message only
- Sales / CRMSource unknown
The visitor arrives with UTMs, but nothing saves them, so the email has no source.
Example: share of monthly leads that sales can attribute before and after adding source fields to the email.
How to check if your site has it
Open your landing page with test UTMs
Visit yoursite.com/page/?utm_source=test&utm_medium=cpc&utm_campaign=check&gclid=abc123 in a fresh private window.
Submit the form
Use a real address you can read, and a name like 'Test Lead'.
Read the notification email
Look for utm_source, utm_medium, utm_campaign, the gclid and the landing page URL.
Check a second page
Click to another page before submitting. Many setups lose UTMs after the first page view.
How to fix it
The method is the same everywhere. Read the UTMs from the URL, store them (a cookie or session storage keeps them across pages), fill hidden form fields on load, and include those fields in the notification email.
(function () {
var keys = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content','gclid','fbclid'];
var params = new URLSearchParams(window.location.search);
keys.forEach(function (k) {
var v = params.get(k);
if (v) sessionStorage.setItem(k, v);
});
sessionStorage.setItem('landing_page', sessionStorage.getItem('landing_page') || window.location.href);
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('form').forEach(function (form) {
keys.concat(['landing_page']).forEach(function (k) {
var input = form.querySelector('[name="' + k + '"]');
var val = sessionStorage.getItem(k);
if (input && val) input.value = val;
});
});
});
})();Add hidden fields
In your form plugin (Gravity Forms, WPForms, Contact Form 7, Fluent Forms), add hidden fields named utm_source, utm_medium, utm_campaign, utm_term, utm_content, gclid and landing_page. Some plugins can fill UTMs from the URL by setting a dynamic default value; if not, use the script above.
Add them to the email
Open the form's notification settings and insert the hidden field tags into the message. In Contact Form 7 add lines like 'Source: [utm_source]' to the Mail tab.
Add hidden inputs to the form
In the theme code, edit the contact form section and add <input type="hidden" name="contact[utm_source]"> and similar fields. Load the script above in theme.liquid so it fills them.
Check the email
Shopify's contact form email lists submitted contact[...] fields in the body. Submit a test to confirm they appear. If you use a form app, use its hidden field option.
Create URL variables
Make URL variables for each query key. Use a Custom HTML tag, fired on All Pages, to run the script above and fill the hidden fields.
Publish and test
Use Preview mode, then submit a form to confirm the email contains the values.
Add hidden fields
Add a Custom Embed inside the form with hidden inputs named utm_source and so on. Add the script in Project Settings > Custom Code > Footer.
Check the notification
Webflow's form email lists submitted fields. Submit a test and confirm they appear.
Add hidden fields
In the form builder, add Hidden fields (or custom fields) for each UTM and set the query key name to match. Enable the option to prefill from the URL.
Add to the email
In the workflow's internal notification email, insert the custom field values from the contact.
Use Wix Forms hidden fields
In Wix Forms, add a hidden field or a short text field, and fill it with Velo code that reads wixLocation.query. Velo must be enabled.
Add to the notification
Submissions notifications list the form fields. Submit a test to confirm.
Add a hidden field
Squarespace form blocks have a Hidden option on fields in some versions. If yours lacks it, put the source in a short text field styled hidden with code injection, and fill it using the script above.
Check the email
Squarespace form emails list all fields. Submit a test to confirm.
Add hidden inputs
Add <input type="hidden" name="utm_source"> for each key inside the form.
Include them server-side
Read the posted values in your handler and print them in the email body. Validate and escape them, since they come from the URL.
Before
- Name, email, message
- No source or campaign
- No click ID
After
- Name, email, message
- Source, medium, campaign
- gclid, landing page and referrer
How to confirm it's fixed
- Submit a test with UTMs in the URL and see them in the email
- Submit after visiting a second page and still see them
- Submit with no UTMs and see the referrer and landing page
- Check that the CRM record holds the same values
- Test every form on the site, not just one
How to prevent it happening again
Source capture breaks quietly when a form is rebuilt, a plugin is updated or a theme changes. Keep the hidden fields in a shared form template. Note the field names in your launch checklist, and retest after every form or theme change. Make sure consent or cookie rules allow the storage you use, and say so in your privacy policy.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your lead form on a schedule, using marked test traffic (utm_source=funnelguard, fg_test=1). It then checks the content of the notification email that arrives, with a check called email_content has_source, to see whether source information is present. If it is missing, you get one alert after a re-check from a second region, with a screenshot and a likely cause. It does not fix the form for you.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial.
Questions people ask
Why is my form notification email missing UTM parameters?
The form never stored them. UTMs live in the URL, and unless hidden fields or a script copy them into the submission, they are gone when the visitor submits. Add hidden fields and fill them from the URL.
How do I add UTM parameters to a contact form email?
Add hidden fields named utm_source, utm_medium and utm_campaign to the form. Fill them with JavaScript from the URL, then insert those fields into the notification email template in your form plugin.
Why do UTMs disappear after the visitor clicks to another page?
The URL changes, so the parameters are no longer in it. Save them in sessionStorage or a first-party cookie on the first page, then read them back when the form loads.
How do I track the source of leads that have no UTMs?
Capture document.referrer and the landing page URL in hidden fields. Organic search, direct and referral leads then still show a useful origin in the email.
Should I store the gclid in my form?
Yes, if you run Google Ads and want to upload offline conversions. Save the gclid in a hidden field and keep it with the lead in your CRM. Check your consent and privacy rules first.
Can I add the source to the email without changing the form?
Not reliably. The email can only print data that was submitted. Some form plugins add page URL or referrer as built-in smart tags, which helps a little, but UTMs need hidden fields.
How can I tell automatically if my notification lacks source info?
FunnelGuard runs your form on a schedule and checks the notification email content for source information. It alerts you if the source is missing.
Related issues
- DLV-015Notification email omits some submitted fieldsFix guide
- DLV-016Notification email shows raw field IDs instead of labelsFix guide
- DLV-017Notification shows unfilled merge tags ({all_fields}, [your-name])Fix guide
- DLV-019Notification sent only for one form, another form on the site has noneFix guide
- DLV-013Reply-To set to the site's own address instead of the lead's emailFix guide
- DLV-001Form submits but no notification email is sent to the businessFix guide