Capture UTM Parameters in Contact Form 7
You can attach campaign attribution to every Contact Form 7 submission and use it in your CRM, spreadsheet or notification email. The approach below adds invisible fields to the form, stores attribution as the visitor browses, and fills those fields automatically when the form is sent.
Why attach attribution to the submission
Knowing which campaigns produce leads and customers, rather than only clicks, is the practical reason to attach attribution to a form submission. When the data is stored with the lead in a CRM or spreadsheet, you can group results by channel, campaign, network or keyword and shift budget toward what converts.
A useful distinction is between raw UTM values and categorised attribution. Raw values only exist where links were tagged. Categorised attribution also identifies Organic Search, Organic Social, Direct and Referral traffic, so reports are not limited to paid campaigns.
Four-step setup
Install the attribution snippet on the site through theme settings, a code-injection plugin such as WPCode, or Google Tag Manager. The snippet reads visitor and UTM information, categorises the source into channels such as Paid Search, Organic Search and Paid Social, and stores it in the browser.
Then add these hidden fields to each lead-capture form, including Contact Us, Request a Quote and email signup forms:
- Channel
- Channel Drilldown 1
- Channel Drilldown 2
- Channel Drilldown 3
- Landing Page
- Landing Page Group
Hidden fields are not seen by the visitor but are part of the submission. At submit time the stored attribution is written into them, so Contact Form 7 captures it alongside the visitor's own details.
Checklist before testing:
- Snippet present on every page where a form may be submitted
- Same six hidden fields present on each form
- Test submission shows channel, drilldowns and landing page populated
- Notification email, form-entries view or CRM record receives the fields
Worked example and persistence
Consider a visitor who clicks a paid search ad for a file-sharing service, lands on the homepage, browses, and later requests a demo. The submitted record could show Channel as Paid Search, with drilldowns identifying the search engine, campaign and advertiser, plus the original landing page and its group. That pattern shows both the campaign that brought the visitor in and the content they first saw.
Persistence matters here: because attribution is stored in the browser, it survives browsing to other pages and a later return visit. Methods that only read UTM values on the landing page would lose the data if the form is completed elsewhere.
Landing page group adds a content view. Recording the full landing URL and its group, such as a blog section, lets you report which parts of the site generate leads and customers, not only which ads do.
Where the data can go next
Once captured, the fields can be viewed in WordPress with a form-entries plugin, added to Contact Form 7 notification emails, sent through a tool such as Zapier to CRM systems including Salesforce, Pipedrive, HubSpot, Zoho and Microsoft Dynamics, or sent to Google Sheets or Excel. The same routing works for any destination that accepts the submitted field values, so the choice depends on where your team already reviews leads and how quickly follow-up needs to happen. A practical check is to submit one test form and confirm the attribution fields arrive intact in each destination you plan to use, since a field that is dropped in transit will not appear in later reports no matter how well it was captured at the form stage. It also helps to decide early which fields are mandatory for reporting and which are optional, so that missing values in a few records do not distort the totals you rely on when comparing channels or campaigns over time. Keeping the field names consistent between the form, the notification email and the CRM record makes that comparison far easier to maintain as forms change. A short written note of the field mapping, kept alongside the form configuration, saves guesswork later when someone new takes over the reporting setup or when a form is rebuilt after a site redesign. Reviewing that mapping once a quarter is usually enough to catch drift before it affects a budget decision. For teams that prefer a spreadsheet first, exporting submissions to Google Sheets or Excel gives a low-friction way to inspect the raw values before committing to a CRM field structure, and the same export can serve as a backup if a later integration needs to be rebuilt from historical records rather than starting from scratch. Either path keeps the attribution attached to the lead rather than stranded in a separate analytics tool that cannot be joined to customer outcomes. Click IDs can travel the same way. Passing GCLID, MSCLKID or FBCLID into the CRM allows the identifier to be returned to the ad platform as an offline conversion when a lead becomes a customer, instead of relying only on thank-you-page visits. This matters most where the gap between first click and closed deal is long, because the ad platform otherwise sees only the early visit and optimises toward it. Storing the identifier with the lead record means the conversion can be reported at the point that actually reflects revenue, and the platform can learn from customers rather than from form fills. As a hypothetical illustration, a team running search and social campaigns might compare two reporting approaches: counting a thank-you-page view as the conversion, or returning the stored click identifier once a deal closes. The second approach generally gives a clearer picture of which campaigns produce paying customers, though it depends on the CRM and ad platform both accepting the identifier and on the sales stages being recorded consistently. Before relying on it, confirm that the identifier is captured on the landing page, that it survives to the form submission, and that the CRM field exists to receive it. Where any of those steps is missing, the offline conversion will not match and the report will understate results. A simple test lead pushed through the full path is the quickest way to verify the chain end to end. For organisations that cannot yet return offline conversions, the same stored identifiers still support internal analysis, such as comparing lead quality between campaigns even when the ad platform itself is not updated. That keeps the option open for later without requiring a rebuild of the capture setup. Treat the identifier fields as part of the same hidden-field set as the channel and landing page values, so they are captured together and reviewed together when the form is edited. If a form is duplicated for a new campaign or landing page, check that the hidden fields came along with the copy, since a missing field is easy to overlook until a report shows blanks. A periodic spot check of recent submissions against the expected field list catches that kind of gap early and keeps the reporting baseline stable across campaigns and quarters. Documenting which fields each report depends on also makes it simpler to hand the setup to a colleague without losing the thread between form configuration, CRM fields and the dashboards built on top of them.
Reports to build after setup
With attribution stored per lead, four reports become straightforward:
- Leads by Channel: monthly lead volume by source, to compare investment against where leads actually originate
- Leads by Meta Ads Network: lead volume across Facebook, Instagram, Messenger and other Meta networks
- Customers by Google Ads Campaign: paying customers by campaign, rather than visitors alone
- Revenue by Keyword: revenue grouped by keyword when keywords are included in Google Ads UTM tracking templates, supporting bid, SEO and messaging decisions
Start with leads by channel, then add customer and revenue fields once CRM stages are reliable. That sequence avoids optimising for form fills that never become customers.
Frequently asked questions
How do hidden fields capture UTM data in Contact Form 7?
Add invisible form fields for Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group. A site snippet captures attribution in the browser and writes it into those fields at submission, so it travels with the name, email and other details the visitor entered.
What if the form is submitted on a different page from the landing page?
Yes. Storing attribution in the browser means a visitor who lands on the homepage, browses services, and submits on the Contact Us page still passes the original campaign data, rather than losing it because the form was not on the landing page.
Why capture more than raw UTM parameters?
Raw UTM capture only covers tagged paid traffic. Channel categorisation also covers Organic Search, Organic Social, Direct and Referral, giving a fuller view of lead sources for budget decisions.
Can click IDs be passed through the form?
Click identifiers such as GCLID, MSCLKID and FBCLID can be passed with the submission, stored in the CRM, and later returned to the ad platform as an offline conversion when the lead becomes a customer.