Contact Form 7 hidden fields let you include source information with an enquiry without asking visitors to enter it. Add the fields, give them a value, then include them in your email or CRM record. You can capture campaign tags directly from the form page's URL. TrackLeadSource addresses the wider task: keeping the available source and visitor journey with a lead, so you can understand which marketing brings customers.
TL;DR
Pass the source with the enquiry. Hidden fields carry information such as source, medium and campaign alongside the visitor's name and message.
Choose how to fill them. Contact Form 7 can read the current URL. Keeping information from earlier pages or visits needs a tracking method too.
Use the context after submission. A recorded journey shows how someone reached you. Add their sales outcome in your CRM to compare the customers your channels bring.
Add lead source to your Contact Form 7 enquiry
A quote request arrives. You know what the person needs, but the message doesn't tell you whether they came from an ad or an unpaid search result. Hidden fields give you somewhere to carry that information. They don't add questions to the visible form.
For a basic setup, use Contact Form 7's native URL capture. You'll need permission to edit the form in WordPress.
Add the fields
Open Contact, choose your form, and add these lines in the Form tab, above the submit button:
[hidden utm_source default:get]
[hidden utm_medium default:get]
[hidden utm_campaign default:get]
Save the form. The default:get setting reads a URL parameter with the same name as the field. For example, utm_source reads the value after utm_source=. This uses the documented hidden field and URL default features.
The three values answer simple questions:
- Source: where did the visit come from, such as Google?
- Medium: what kind of traffic was it, such as paid search?
- Campaign: which marketing campaign brought the visit?
Include the values in your email
In the Mail tab, add these lines to the Message body, below the visitor's details:
Source: [utm_source]
Medium: [utm_medium]
Campaign: [utm_campaign]
The Form tab creates the fields. These mail-tags put their submitted values in the email you receive. See Contact Form 7's mail configuration guide.
If enquiries already go to your CRM or spreadsheet, include the new fields in that connection's mapping as well. Otherwise, the email may have the source while the CRM still has an empty field.
Send a test enquiry
Replace the domain and path below with the page containing your form:
https://example.com/contact/?utm_source=google&utm_medium=cpc&utm_campaign=quote_requests
Submit the form. The expected email values are google, cpc and quote_requests. These are test labels, not a real campaign result. Check the CRM record too, if connected.
Contact Form 7 itself doesn't keep a submissions database. If you want records inside WordPress, use a storage option such as Flamingo, which its developers recommend.
What happens when someone visits another page first?
The basic setup works when the form page's URL contains the campaign tags. But a potential customer may want to read about your services before asking for a quote.
Imagine you run a home renovation business. Someone clicks your Google ad, reads the kitchen renovation page, looks at a completed project, then opens your contact page. If that final URL has no campaign tags, the native fields have nothing to read.
You still receive the enquiry. The information connecting it to the ad is missing.
That matters when you decide whether to keep running the campaign. You may know it generated clicks, yet be unable to connect those clicks with the people requesting quotes.
To keep the source through that journey, a tracking method must capture it on arrival, retain it during browsing, and populate the fields before submission. A developer can build that behaviour, or you can use a tracking tool. The native field setup above handles the current URL only; each tracking tool has its own field configuration.
How TrackLeadSource adds context to a form lead
TrackLeadSource's role is to collect the available source information as someone browses and pass it through hidden fields with their enquiry. That includes source, medium and campaign, plus the recorded source journey and pages visited.
For the renovation business, the useful result is a lead with context like this. This is an illustrative example:
| What you want to know | Context attached to the enquiry |
|---|---|
| How did they first reach us? | A Google ad for kitchen renovations |
| Did they come back? | A later visit through a newsletter |
| What did they look at? | Kitchen renovations → completed project → pricing → contact |
| What are they asking for? | A quote for a kitchen renovation |
The source journey shows the recorded arrival and return channels. The page path shows what the visitor explored on your website. If you only keep the most recent source, you may see the newsletter and miss the earlier ad visit.
This context can also help the person replying. They can see which service and project pages the visitor viewed, alongside what the enquiry actually says. A page view isn't proof of interest or a sale, but it can help prepare a relevant conversation.
Later, your team records whether the enquiry was suitable and whether it became a customer. With those outcomes alongside the source data, you can compare campaigns by the work they bring in. A busy inbox alone can't tell you that.
For example, if one campaign repeatedly brings enquiries outside your service area, review its targeting. If another brings suitable projects that become customers, that deserves attention when planning the next budget. TrackLeadSource supplies the recorded context; your CRM or spreadsheet holds the qualification and sales results.
That's the reason to track lead source beyond collecting a few campaign labels. You want information you can use to improve your marketing. Our guide to measuring lead quality by source covers that next step.
Browser tracking still has gaps. Blocked tracking, cleared browser data and visits on another device can break the recorded journey. Use the available history without assuming every interaction was captured.
TrackLeadSource
See the story behind each lead.
Keep source, campaign, and journey context together when a visitor becomes a lead.
14-day free trial. Cancel anytime
Tell paid and unpaid visits apart
“Google” on its own doesn't tell you whether an enquiry came from an ad or a regular search result. The same applies to Facebook ads and unpaid posts.
UTM parameters are labels you add to campaign links. For example, a Google ad could use google / cpc, while Facebook links could use facebook / paid_social for ads and facebook / social for unpaid posts. Consistent labels make those groups easier to compare. Google's campaign URL guide explains the parameters.
Untagged visits may still provide a referrer: information about the page that sent the visitor. That can help identify a referring website or search engine. Capture it on arrival; after browsing, the referrer on the contact page may simply be your own service page.
A referrer alone doesn't reliably distinguish every paid and unpaid visit. Missing UTMs don't prove a visit was organic. When there isn't enough evidence, keep the source unknown rather than making your reports look more certain than they are.
Check that the source reaches the right place
Start with one form. Test a direct arrival from a tagged link, then repeat after visiting another page first. If you use tracking that retains source data, also test a return through a different campaign.
Open the actual email or saved lead after each submission. Check the source values there, not just the success message on your website.
| What you find | What to check |
|---|---|
| Blank values on the tagged form page | Field names must match the URL parameters. Check that the updated form is being served. |
| Values in the form but missing from the email | Add the matching mail-tags in the Mail tab. |
| Values in the email but missing from the CRM | Check the connection's field mapping. |
| Direct arrival works, browsing first doesn't | Check whether your setup retains source information between pages. |
Once that path works, keep the source context beside the enquiry as your team follows up. That's how a small change to the form becomes useful information for your next marketing decision.
Common questions
No. Contact Form 7 supports hidden fields and URL-based defaults natively. Keeping values from earlier pages or visits requires an additional tracking method. Saving submissions in WordPress is a separate decision too.
Yes, through browser developer tools. Hidden means the field isn't displayed in the form. It doesn't make the value secret or tamper-proof. MDN explains this distinction. Don't use a hidden value as proof of identity or permission.
Yes. Add [_url] to the email's message body to include the form page URL. Contact Form 7 documents it under special mail-tags. That identifies the page containing the form, not the original traffic source or every page visited earlier.
Add the required fields and mail-tags to each form you want to track. Check each destination separately. For tracking that fills fields with stored data, test every form, including forms loaded in popups. A working contact page doesn't prove the popup receives the same values.
No. The native field method reads parameters from the page URL and sends their values with the form. It doesn't depend on Google Analytics. Analytics reporting can complement individual lead records, but it doesn't replace checking the source data saved with each enquiry.
Helping marketers connect website form submissions to their source, campaign, and customer journey.


