Lead Source Tracking for WordPress: The Complete Setup Guide

Most WordPress service businesses know which channels they are paying for — Google Ads, Facebook, email, organic search. What most cannot tell you is which of those channels is actually producing customers. Not clicks, not form submissions, not even leads. Customers.

That gap is a lead source tracking problem. This guide covers how to close it: what to set up, what tools to use, and how to connect the data from first click to closed deal.

Why “How Did You Hear About Us?” Does Not Work

The instinct to ask customers how they found you is understandable. It is also unreliable. Studies consistently show that people attribute their discovery to the last touchpoint they remember, which is often a Google search for the company’s name — even if the original discovery came from a Facebook ad, a referral, or an organic blog post months earlier.

Self-reported lead source data is confirmation bias at scale. People do not accurately remember or report their full decision path. You need systems that capture source data automatically, without depending on anyone to tell you anything.

The Four Things Lead Source Tracking Must Capture

A complete lead source setup captures:

  1. Channel and campaign: where did the traffic come from (Google Ads, organic, Facebook, email, referral) and which specific campaign or effort drove it
  2. Form submissions: which leads submitted a contact form, and from which source
  3. Phone calls: which leads called (not just visited), and from which source
  4. Revenue outcomes: which of those leads became paying customers, and what they were worth

Most setups capture #1 in GA4 and stop there. The result is a system that can tell you which channels drove sessions, but not which channels drove revenue. Building toward #4 is the goal.

Layer 1: UTM Parameters for Channel and Campaign Tracking

UTM parameters are tags appended to your URLs that tell GA4 and your own systems where traffic is coming from. A tagged URL looks like this:

https://yoursite.com/contact/?utm_source=google&utm_medium=cpc&utm_campaign=plumbing-emergency

Google Ads populates UTM parameters automatically if you enable auto-tagging (recommended) or if you use final URL suffixes in your campaign settings. For Facebook, email campaigns, and other channels, you tag URLs manually using Google’s Campaign URL Builder or a similar tool.

UTMs alone capture the session. They do not follow the visitor when they submit a form — that requires the next layer.

Layer 2: First-Party Cookies for Session Attribution

When a visitor arrives with UTM parameters in the URL, a JavaScript snippet captures those values and stores them in first-party cookies. This preserves the attribution data across the session and, if you configure a long enough cookie window (30 days is standard), across return visits.

The key behavior: the script should write the cookie only if UTM values are present in the current URL. A returning visitor who comes back via direct traffic should not overwrite the original paid attribution. First-touch attribution, stored in cookies, is the foundation of accurate lead source reporting.

This script runs on every page load and can be installed via Google Tag Manager, WPCode, or your theme’s functions.php. It requires no third-party service — it writes data to the visitor’s browser in your own first-party domain.

Layer 3: Hidden Form Fields That Carry Attribution Into Your CRM

Once UTM values are stored in cookies, your contact forms need to read those values and include them in each submission. This is done with hidden fields: invisible form inputs that populate automatically from the cookie values when the page loads.

Every major WordPress form plugin — Gravity Forms, WPForms, Contact Form 7, Fluent Forms — supports hidden fields with dynamic default values. You add one hidden field per UTM parameter, configure each to read the corresponding cookie, and the attribution data flows silently with every lead submission.

The result: each lead record in your CRM, email inbox, or spreadsheet includes utm_source, utm_medium, utm_campaign, utm_content, and utm_term alongside the contact information the visitor submitted.

Layer 4: Phone Call Attribution via Dynamic Number Insertion

For most WordPress service businesses, phone calls represent a significant share of lead volume — often 30 to 60 percent. If calls are not tracked by source, a major portion of conversion data is invisible to attribution.

Dynamic number insertion (DNI) solves this. A JavaScript snippet detects the visitor’s traffic source and replaces the phone number shown on the page with a unique tracking number tied to that source. Someone who arrived from Google Ads sees a different number than someone who came from organic search. When they call, the call tracking platform records the source and passes it to your reporting.

CallRail is the standard tool for this in the WordPress ecosystem. For businesses getting 20 or more calls per month, DNI is the highest-leverage attribution investment available — it closes the source gap on the portion of leads that never submit a form.

Layer 5: Connecting Closed Deals Back to Source

The previous layers tell you which channels are generating leads. Layer 5 tells you which channels are generating revenue. This is where lead source tracking becomes a genuine business intelligence tool.

The mechanism depends on your CRM setup:

  • CRM with custom fields: if you mapped UTM values to custom fields in HubSpot, Pipedrive, Close, or another CRM via your form integration, you can pull close rate and revenue by source directly from the CRM. Filter closed deals by utm_source and sum revenue.
  • Spreadsheet-based: if you use a spreadsheet as your lead log, add a “Closed” column and a “Deal Value” column. Monthly, update each row with the outcome. Then pivot by utm_source to see close rate and revenue by channel.
  • Offline conversion upload: for Google Ads, you can upload closed deal data as offline conversions. Google uses the gclid (click ID, separate from UTMs) to match the deal back to the campaign and keyword, updating its bidding signals with actual revenue data rather than just form submissions.

What to Do With Lead Source Data

Once you have reliable lead source data connected to revenue outcomes, the decisions become obvious:

  • Budget allocation: which channels produce the highest close rate? Move budget toward them. A channel generating 20 leads at 5 percent close rate should receive less budget than one generating 8 leads at 40 percent close rate, regardless of cost per lead.
  • Negative keywords in paid search: utm_term (the search query that triggered the ad) attached to zero-conversion leads tells you which search terms are pulling unqualified traffic. Add them as negatives.
  • Content prioritization: organic traffic with high close rates indicates content that attracts buyers, not browsers. Expand that content cluster.
  • Channel shutdowns: a channel that generates lead volume but consistently zero revenue is burning budget on awareness that does not convert. Cut it.

Common Setup Mistakes to Avoid

  • UTMs stripped by redirects: if your landing page URL redirects before the page loads (www to non-www, HTTP to HTTPS, or a tracking redirect), UTM parameters can be dropped. Test your landing page URLs for redirect chains before going live.
  • Form caching blocking cookie reads: some caching plugins prevent JavaScript from running on form pages, so hidden fields do not populate. Add form pages to your caching exclusion list.
  • Session storage instead of cookies: sessionStorage loses data when the browser closes. Use document.cookie with a 30-day expiry for reliable cross-session attribution.
  • Last-touch overwriting first-touch: if your cookie capture script writes on every visit regardless of UTM presence, a direct return visit will overwrite a paid ad visit from a week earlier. Only write when UTM parameters are actually in the URL.
  • Mismatched form-to-CRM field mapping: hidden UTM fields in the form do nothing if they are not mapped to the CRM or notification template. Verify the full data pipeline with a test submission after setup.

Putting It Together: A One-Week Setup Plan

For a WordPress service business starting from scratch, a working lead source tracking setup is achievable in a week:

  1. Day 1-2: install the UTM capture script (via GTM or WPCode). Test by visiting your own site with UTM parameters in the URL and confirming the cookies are written in browser developer tools.
  2. Day 3: add hidden UTM fields to your main contact form. Submit a test form and verify UTM data appears in the email notification or CRM record.
  3. Day 4: set up call tracking with dynamic number insertion for your top traffic sources. Confirm numbers are swapping correctly on arrival from each source.
  4. Day 5: add a Lead Source column to your CRM or lead spreadsheet. Verify it is populating from form submissions.
  5. Day 7: review your first week of attributed lead data. Check which sources are generating submissions and calls. You now have the foundation to measure ROI by channel.

For a plug-and-play version of this stack built natively for WordPress — UTM capture, form field enrichment, call tracking integration, offline conversion sync, and closed-loop revenue reporting in a single plugin — Sales Provenance is designed to handle every layer described here without requiring custom development.

Related reading: UTM parameter tracking on WordPress, Google Ads conversion tracking for WordPress, and marketing attribution for agencies.