Contact Form 7 UTM tracking that survives the click to your contact page
Add a few [hidden] tags to your form and TraceLead fills them with where the visitor first came from: the Google ad, the newsletter, the search, the referral. The source arrives in the email Contact Form 7 sends, and in any CRM add-on that reads the form.
No card needed. No lead caps on any plan.
- Contact Form 7 and WordPress plugin: Tested on every release against the builder's markup
- How we test
Added by TraceLead's hidden fields. The name and email stay in your form.
- Channel
- Paid search
- Source / medium
- google / cpc
- Campaign
- brand-uk
- Click ID
- gclid
Why Contact Form 7 hidden fields arrive empty
A [hidden] tag only holds what something puts in it. The usual fix, a script that copies utm_source from the address bar, works only when the visitor sends the form on the page they landed on.
Most don't. They land on a blog post or a pricing page, read on, and enquire from /contact, sometimes days later. By then the UTM tags and the gclid are gone from the URL, and visits from search, social and referrals never had any.
-
Monday
Clicks a Google ad, lands on
/pricing?utm_source=google&utm_medium=cpc&utm_campaign=brand-uk&gclid=…, leaves. -
Thursday
Types your address, opens
/contact, sends the Contact Form 7 form.
| Hidden field | Read from the URL | Filled by TraceLead |
|---|---|---|
| tl_channel | empty | paid_search |
| tl_source | empty | |
| tl_utm_campaign | empty | brand-uk |
| tl_gclid | empty | Cj0KCQjw… |
| tl_landing_page | /contact | /pricing?utm_source=google&utm_medium=cpc |
TraceLead keeps the first visit in a first-party cookie on your own domain once your banner allows it, and fills the fields on whichever page the form is sent from.
How to add UTM tracking to Contact Form 7
Four steps, all inside WordPress. Nothing about the form changes for the person filling it in.
The full Contact Form 7 guide-
Add the TraceLead tag to your site
Install the TraceLead WordPress plugin and paste your site ID under Settings → TraceLead. It prints the script tag on every page. Already manage tags another way? Paste the one-line script tag in your theme or Google Tag Manager instead.
-
Add hidden tags to the form
In the form editor, add Contact Form 7's own
hiddentag for each value you want, namedtl_plus the field:[hidden tl_channel] [hidden tl_source] [hidden tl_utm_campaign] [hidden tl_gclid] [hidden tl_landing_page] -
Put them in the email, or your CRM
In the Mail tab, add the matching mail tags,
[tl_channel],[tl_utm_campaign]and so on, wherever you want them in the message. If an add-on sends the form to a CRM, map thetl_fields there like any other field. -
Connect your cookie banner
Nothing is stored or filled until the visitor agrees. In Settings → TraceLead, follow the WordPress Consent API (Complianz and other plugins that implement it), or let your banner tell TraceLead directly. Then visit your site with
?utm_source=test&utm_medium=cpc, accept cookies, send a test entry and check the email.
What arrives in your Contact Form 7 email
Pick the fields you want; leave out the rest. Each one is a plain value your inbox, spreadsheet or CRM can sort and filter.
Also available: utm_term, utm_content, Microsoft, Meta, LinkedIn, TikTok and X click ids, the referring site, and optionally the last touch and the number of visits before the enquiry.
| Contact Form 7 tag | Holds | Example |
|---|---|---|
| [hidden tl_channel] | The channel the first visit came from | paid_search |
| [hidden tl_source] | Where it came from | |
| [hidden tl_medium] | How it came | cpc |
| [hidden tl_utm_campaign] | The campaign name from your UTM tags | brand-uk |
| [hidden tl_gclid] | Google Ads click id, for offline conversion import | Cj0KCQjw… |
| [hidden tl_referrer_host] | The site that sent the visit | chatgpt.com |
| [hidden tl_landing_page] | The first page seen, sensitive parameters removed | /pricing? |
| [hidden tl_first_touch_at] | When the first visit happened | 2026-10-05T09:14:02Z |
Attribution without personal data. No names, emails, form values, IP addresses or user agents. Ever.
No privacy workarounds. Nothing before consent, no fingerprinting, no ad-blocker bypass, no cross-site identity.
Made in the UK. GBP pricing, UK consent rules in mind, and a person who answers email.
Questions, answered
Anything else? Email us and a person replies.
Can Contact Form 7 capture the gclid?
Yes. Add [hidden tl_gclid] (and [hidden tl_gbraid] and [hidden tl_wbraid] for Google's iOS click ids) to the form. TraceLead keeps the click id from the first visit for the lifetime you set, 90 days by default, so it is still there when the visitor enquires days later from another page, ready for an offline conversion import in Google Ads.
Do I need a separate Contact Form 7 UTM plugin?
No. The fields are Contact Form 7's own [hidden] tags. The TraceLead WordPress plugin only prints the script tag and passes your cookie banner's answer to it; you can paste the script tag yourself instead.
What do visitors without UTM tags show as?
They are still classified, from the click id or the referrer: a Google search arrives as google / organic, a LinkedIn post as linkedin / social, a link from another site, ChatGPT usually included, as that site / referral, and a typed address as direct. The rules are published in the docs.
Does a later direct visit overwrite the source?
No. The first touch is kept; a return visit from a bookmark never replaces a recorded campaign. If you also want the most recent campaign, switch on last touch for the site and add [hidden tl_last_utm_campaign] and the other last_ fields beside the first-touch ones.
Does TraceLead see what people type into the form?
No. The snippet writes into the hidden fields and never reads any value in the form. The enquiry goes from Contact Form 7 to your inbox exactly as before; TraceLead keeps only a pseudonymous lead record (random ids, the form id and page path, and its channel and campaign) for your dashboard, if you leave lead collection on.
What happens before a visitor accepts cookies?
Nothing is stored and the fields stay empty until your consent banner says yes. The plugin can follow the WordPress Consent API (Complianz and others) or your banner can call TraceLead directly; the form submits either way.
What if TraceLead is down or blocked?
The form still submits. The hidden fields are simply empty for that enquiry; nothing in Contact Form 7 waits for TraceLead.
Your next Contact Form 7 email, with its source.
Install the plugin or paste the tag, add the hidden tags and the mail tags.
No card needed. Cancel any time.
[hidden tl_channel]
[hidden tl_source]
[hidden tl_utm_campaign]
[hidden tl_gclid]
Mail tab:
Source: [tl_channel] / [tl_source]
Campaign: [tl_utm_campaign]
Google click id: [tl_gclid]