Contact Form 7 integration

How to track the source of your leads in Contact Form 7.

Contact Form 7 emails you the data and nothing else. No hidden field type either, so here is how to get the source in anyway.

Works with all CF7 form types and shortcodes Free official plugin, or one script - your pick Free tier · no card

Works with every CF7 form on your site.

Any Contact Form 7 form, anywhere on your WordPress site. Shortcode-embedded, in widgets, on landing pages, in popups. No per-form configuration. Works with Flamingo, the official storage add-on, but doesn’t require it.

Two ways to run it

Two ways to run it on Contact Form 7.

Run the free official plugin and every lead stays in your own WordPress admin, or paste one hosted script and they arrive in your Lead Source dashboard. Either way the capture is identical. Pick on where you want the data sitting.

Free · WordPress.org

The official plugin

  • Captures the source on every CF7 submission, stored in your WordPress admin
  • Two-click install from the directory, no account needed
  • Runs alongside your existing CF7 forms and Flamingo, nothing to reconfigure
View on WordPress.org
Hosted · any platform

The one-line script

  • One JavaScript line in your <head>, no plugin and no PHP
  • Leads land in your Lead Source dashboard, independent of WordPress
  • Survives a rebuild, host change or full migration
Start free →
The CF7 attribution problem

An email arrives. That’s the whole product.

Contact Form 7 is deliberately minimal. It emails you the field values. That is it. There is no source data anywhere. Not in the email, not in Flamingo, not in the database.

What the CF7 email gives you
What Lead Source captures
Name, email, message
Name, email, message. plus everything else
(no source)
Google Ads · Local Services Sydney
(no campaign)
Campaign: managed-it-sydney-exact
(no page journey)
/managed-it → /pricing → /contact
(no UTMs)
All UTMs captured at landing, even if visitor browsed for 20 minutes before submitting

CF7 is great at what it does. Attribution just isn’t what it does.

How it actually works

One snippet on your WordPress site. Source on every CF7 submission.

  1. 01
    Lead Source captures the visitor’s real source, campaign, and page journey when they land on any page of your WordPress site. UTMs, referrer, ad click ID, full session journey.
  2. 02
    When the visitor submits a CF7 form, Lead Source intercepts the submission client-side and forwards the form data and source to your Lead Source inbox. Alongside CF7’s normal email notification.
  3. 03
    CF7 keeps doing what it does. Sending the notification email, writing to Flamingo if you have it installed, running your existing CF7 actions. Lead Source adds the source data in parallel without touching CF7’s flow.
  4. 04
    No PHP, no plugin install, no functions.php edits. Just the snippet in your site header.
The starting point

Contact Form 7 has no hidden field type

Every other form plugin in this category ships a hidden field. Contact Form 7 does not. Its tag generator offers text, email, phone, dates, files and the rest, and every one of them is visible to the person filling the form in.

That is a design position rather than an oversight. Contact Form 7 is deliberately small and expects you to extend it. It does mean the usual approach, drop in a hidden field and write to it, needs a step in front of it.

The two that work

Capturing the source without a hidden field type

The first route is to add hidden field support with an extension. Several exist, they are widely used, and once one is installed the setup matches any other plugin. Add a hidden field per value you want, then have something populate it before submission.

The second is to capture the value server side as the submission is processed, rather than on the form at all. The source gets attached on the way through. The form markup never changes, and there is no hidden field to forget when you build the next form.

The second is the sturdier of the two once you run more than a handful of forms, because it needs no per-form configuration. Form tracking works this way.

Four failure modes

Why Contact Form 7 tracking breaks on multi-page visits

When the value arrives empty it almost always comes down to one of four things.

The field is on the form and not in the Mail tab, so it never leaves the site, or the session was not held, so the parameters sat on the landing page while the visitor moved on, or nothing writes to the field at all, which looks like a tracking gap and is a configuration gap, or the value went in raw, so Google turns up under three spellings and no report groups them.

The first is specific to Contact Form 7 and catches almost everyone. A field added to the form does nothing until it is added to the Mail tab as well, and whatever does arrive still needs resolving against a fixed lead source taxonomy before it is worth reporting on.

The snippet

One line, before the closing </head>.

Lead Source installs in a few minutes and works with the hidden fields you already have. If you want to see what your current setup records before changing anything, start with the source your forms are capturing today.

<script async src="https://app.leadsource.co/ft.js" data-site="YOUR_SITE_KEY"></script>

Drop this in your WordPress theme header (or use a plugin like Insert Headers and Footers). Lead Source auto-detects all CF7 forms on the page and binds the source data on submit. No per-form configuration.

Three-step install

Done in five minutes.

01

Add the snippet to your WordPress site

Easiest path: install Insert Headers and Footers (or any equivalent), paste the script into the “Scripts in Header” box, save. Comfortable in PHP? Drop it into your theme’s header.php before </head>.

02

No CF7 configuration needed

Lead Source detects every CF7 form on every page automatically. No shortcode changes, no plugin install, no functions.php edits. Existing CF7 setups work as-is.

03

Submit a test form

Open one of your CF7 forms with a UTM in the URL (e.g. ?utm_source=google&utm_campaign=test) and submit. You’ll see the new lead in your Lead Source dashboard with the source, campaign, and page journey, alongside the CF7 email that lands in your inbox.

Common questions

Questions, answered.

Can I use the WordPress plugin instead of the script for Contact Form 7?

Yes. The free Lead Source plugin is on the WordPress.org directory. Search Plugins, Add New for "Lead Source", install and activate, and it captures the source on every Contact Form 7 submission with every lead stored in your own WordPress admin. Prefer not to run a plugin? The hosted script is one line of plain JavaScript in your site's <head>, with leads landing in your Lead Source dashboard instead. Both capture the same thing.

Does this work with Flamingo?

Yes. Lead Source runs in parallel. CF7 still writes to Flamingo for storage, and the source data lives in your Lead Source dashboard. Flamingo gets the form fields; Lead Source gets the form fields plus the source.

Will this break my existing CF7 actions or integrations?

No. Lead Source captures form submissions client-side without intercepting or altering the CF7 submit flow. Email notifications, Flamingo logging, Mailchimp connections, and any other CF7 integrations keep working as before.

What about CF7 forms inside popups or modals?

Works. Lead Source binds to CF7 forms whenever they appear in the DOM, including dynamically-loaded popup forms from plugins like Popup Maker or Elementor popups.

My host blocks third-party scripts. Can I self-host?

The Lead Source snippet is served from our CDN by default. For locked-down hosts or stricter CSP setups, contact us. We can issue a self-hosted version of the tracker that lives on your domain.

See your real Contact Form 7 lead sources.

Free. Five-minute install. No credit card.

Start free

Free to start ยท no card