How to Track UTM Parameters in Contact Form 7

See which campaign sent each Contact Form 7 lead. Add one script tag, no hidden fields, then test with a UTM link.

Author
SourceTrack Team
Read Time
05 Mins read
Published Date
How to Track UTM Parameters in Contact Form 7

Contact Form 7 sends you the message, but not the campaign behind it. This guide shows how to see both. Add one script tag, and SourceTrack links each Contact Form 7 lead to the link that brought the visitor in.

Step 1: Add the script tag

Copy your one script tag from SourceTrack. Paste it into the head of your website, once. The install guide shows where it goes. On WordPress, see the WordPress guide.

Step 2: Put your Contact Form 7 form on a page

Show your Contact Form 7 form on a page of your site as you normally do. SourceTrack captures a Contact Form 7 form that sits directly on your page. Do not add any hidden fields.

Open your page with UTMs on the end of the link, like this:

https://yourwebsite.com/contact?utm_source=test&utm_medium=email&utm_campaign=form_test

Open it in a new private window. If your browser sends Do Not Track or Global Privacy Control, SourceTrack respects that and will not track the visit. Fill in the form and send it.

Step 4: Look at the lead in SourceTrack

Open SourceTrack and find the new lead. Check that the source, medium and campaign match your test link.

How Contact Form 7 handles UTM parameters on its own

Contact Form 7 has no built-in marketing fields. The Contact Form 7 documentation on default values from the context describes a default:get option for a form tag. The field then takes its default value from the URL variable with the same name, so a field named your-name can read ?your-name=John+Smith. For campaign tracking you add one field per UTM tag, name each field after its parameter, and use that option on each.

Where that route fails:

  • Page caching. The documentation does not describe caching. If your page is cached, the value that was filled in may be old or empty, so test with a fresh tagged link.
  • The visitor moves to another page. The field reads the link of the page that holds the form. If someone lands on one page from an ad and then opens your contact page, the tags are no longer in the link.
  • First touch against last touch. Each field holds one value from one page view, so it cannot show the first and the last source together.
  • Multi-step forms. Contact Form 7 forms are single forms, and any plugin that splits them into steps changes how the field values carry over. Check that plugin’s documentation.

What you will see

Your test lead shows the source test, the medium email and the campaign form_test. You also see the page the visitor landed on. If you see these, Contact Form 7 is tracking UTMs for you.

What SourceTrack records for each Contact Form 7 lead

When someone sends a Contact Form 7 form on a page that has the script, the lead is linked to the visit that brought them. For each lead you can see:

  • UTM parameters: utm_source, utm_medium, utm_campaign, utm_content and utm_term.
  • Ad click IDs: gclid for Google Ads, fbclid for Meta Ads, msclkid for Bing Ads and li_fat_id for LinkedIn Ads.
  • Referrer and landing page: the site that sent the visitor and the first page they viewed.
  • First touch and last touch: both appear in the lead’s touchpoint timeline, so you can compare what started the journey with what closed it.
  • AI assistant referral: when the visit came from ChatGPT, Claude, Perplexity or Gemini, the lead shows which assistant it was.

The form name and the page address are saved with the lead as well. All of this comes from the visit, not from the form, so none of it needs a field in Contact Form 7.

Common problems and fixes

Most missing leads come down to a short list of causes. Work through them in order.

  • Nothing shows up at all. View the page source and check that the script tag sits inside the <head>. Then open your browser’s developer tools, choose Network, filter by track and reload. A successful request means the script is running. The install guide shows where the tag goes, and the WordPress guide covers header plugins.
  • Do Not Track or Global Privacy Control is on. SourceTrack respects both. If your browser or an extension sends either signal, the tracker does not run, and your test visit will not appear. Test in a browser without them, or turn the setting off for the test.
  • Caching or minify. After you paste the tag, clear your site cache. If a cache plugin bundles JavaScript, exclude tracker.min.js from minification and defer lists, then look for errors in the browser console.
  • The form is inside an iframe. A form in an iframe submits in its own frame, which the page script does not see. SourceTrack captures forms that sit directly on your page.
  • The test looks wrong. Open your tagged link in a new private window, not a tab you used before, and open it directly rather than clicking through from another page on your site. The link needs the tags the first time the visitor arrives.
  • Everything shows as Direct. The visit had no tags and no referring site. Tag the links you control. The troubleshooting guide explains why a visit can arrive without a referrer.

Further reading

Frequently asked questions

Do I need hidden fields in Contact Form 7?

No. Once the script is on your site, SourceTrack captures Contact Form 7 forms that sit on your page. You do not change the form.

SourceTrack still looks at where they came from, such as a search engine or another website. If the link has no tags and the visit has no referring site, it shows as Direct. So tag the links you control, like emails, ads and social posts.

Why did my test lead not show up?

First, check that the script tag is on the page with the form. Second, try a private window that does not send Do Not Track or Global Privacy Control, because SourceTrack respects both. Then see the troubleshooting guide.

What if the visitor browses other pages before they reach the Contact Form 7 form?

The lead is still linked to the visit that brought them to your site, because SourceTrack reads the visit and not the page the form is on. The lead shows the first touch and the last touch, so the original ad or email is not lost when someone clicks from a landing page to your contact page.

Does this work if my Contact Form 7 form is inside an iframe?

A form loaded inside an iframe submits in its own frame, which the page script does not see. SourceTrack captures forms that sit directly on your page. If your form is in an iframe, check the integrations page for another way to send the submission.

Next step

Tag the links you share, then watch the leads come in. Learn the basics in how to track UTM parameters, read the install guide or the troubleshooting guide, or see how every tool connects.

Related Blogs

How to Track UTM Parameters: The Basics

Learn what UTM parameters are, how to build tagged links, and how to see which campaign sent each lead. Plain steps, no code.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026

How to Track UTM Parameters in Cal.com

See which campaign sent each Cal.com booking. Add one script tag to the page with your embed, then test with a UTM link.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026

How to Track UTM Parameters in Calendly

See which campaign sent each Calendly booking. Add one script tag to the page with your embed, then test with a UTM link.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026