How to capture UTM parameters in Contact Form 7
Two ways to get utm_source, utm_campaign and friends into your Contact Form 7 leads: the built-in hidden-field method, where it breaks, and how to capture the whole trail instead.
What you're capturing
UTM parameters are the tags on a campaign link: utm_source (google, facebook, newsletter), utm_medium (cpc, email, social), utm_campaign, and optionally utm_term and utm_content. Ad platforms add their own click IDs too, such as gclid from Google Ads and fbclid from Meta.
All of them arrive in the URL of the first page a visitor lands on. Contact Form 7 doesn't save any of it by default, so a lead from a $40 click looks exactly like one from a business card.
Method 1: hidden fields with default:get
Contact Form 7 can fill a field from the page URL. The default:get option tells a form-tag to take its value from the query-string parameter with the same name.
Step 1: add hidden form-tags
Open Contact → Contact Forms, edit your form, and add one hidden tag per parameter anywhere inside the form:
[hidden utm_source default:get] [hidden utm_medium default:get] [hidden utm_campaign default:get] [hidden utm_term default:get] [hidden utm_content default:get] [hidden gclid default:get]
Step 2: add the values to your email
Hidden fields don't show up in the notification on their own. In the Mail tab, add their mail-tags to the message body:
Source: [utm_source] Medium: [utm_medium] Campaign: [utm_campaign] Keyword: [utm_term] GCLID: [gclid]
Step 3: test it
Open the page with test tags on the URL, for example /contact/?utm_source=test&utm_medium=cpc&utm_campaign=guide, submit the form, and check the email.
Where the hidden-field method breaks
The test works because you submitted on the page you landed on. Real visitors rarely do, and that's where the gaps show up:
- The tags only live on the landing page. Someone clicks your ad, lands on a service page, then opens
/contact/. The contact page's URL has no UTMs, so every field arrives empty. - Most leads aren't tagged at all. Organic search, Google Business Profile, AI assistants like ChatGPT, referrals and direct visits carry no UTMs. Those leads get blank fields, not a channel.
- Page caching can blank the values.
default:getis filled in on the server when the form renders. Some caches serve the same cached page for UTM-tagged links, so the form loads without them. - No first or last touch. A lead who first clicked an ad and came back a week later through Google shows only what's in the URL that day.
- It's per form. Every form needs the same six tags and mail-tags, and a form someone adds later is a silent gap.
Method 2: capture the whole trail with Contact Trail
Contact Trail Pro is a WordPress plugin that does what Method 1 can't, with no tags to add:
- Install and activate it, then enter your license key under Contact Trail → License.
- That's the setup. Contact Trail adds its hidden attribution fields to every Contact Form 7 form when the form renders.
- Submit a test lead. It appears under Contact Trail → Submissions with its channel, UTMs, click IDs, referrer, landing page and first/last touch.
Behind the scenes it reads the trail in the browser on the first pageview, keeps it across pages and visits (with a server-side cookie that outlasts Safari's 7-day limit), classifies it into one of 12 channels such as Paid Search, Organic Search, Google Business Profile or AI Search, and stores it with the submission in your WordPress database. No Flamingo needed for a record of the lead.
# What a Contact Form 7 lead looks like in Contact Trail channel Paid Search utm_source google utm_medium cpc utm_campaign spring_promo gclid Cj0KCQ…aAv landing_page /services/ first / last Organic Search → Paid Search
utm_source and gclid, so check your form doesn't end up with duplicates.Using the data: email, CRM and GA4
- In your notification email: Contact Trail adds an Attribution tab to the Contact Form 7 editor with a ready-made email snippet, and fields such as
[channel],[utm_source]and[gclid]work as mail-tags. - In a spreadsheet: export any filtered view as CSV, including the message and every attribution field.
- In your CRM or Zapier: a signed webhook posts every submission as JSON, and a REST API serves leads as JSON or CSV.
- In GA4 or Google Tag Manager: a
contact_trail_submissionevent fires on each successful submission with the channel, source, campaign and click ID. - In Google Ads: the stored GCLID is the most recent click, the one Google needs to match offline conversions.
Contact Form 7 UTM questions.
Only for visitors who submit on the page whose URL still carries the tags, and only when that page isn't served from a cache that ignores UTM parameters. Everyone else submits blank values.
Usually because the visitor browsed to another page before submitting, arrived without tags (organic, direct, referral), or the page came from a cache. Also check that the mail-tags, such as [utm_source], are in the Mail tab's message body.
Not with hidden fields alone. Contact Trail classifies untagged visits from the referrer, so organic search, Google Business Profile, AI assistants, social and referral leads still get a channel.
For Method 1, yes, if you want a record outside your inbox. With Contact Trail, every submission and its form contents are stored on the Submissions screen, so Flamingo is optional.
Contact Trail supports both, side by side with Contact Form 7. See the WPForms and Gravity Forms pages.
Skip the hidden fields.
Capture the full trail on every Contact Form 7 lead in about five minutes. Free for 14 days, then $29.99/month.