You’ve set up UTM tracking on your WordPress site. Your JavaScript snippet captures parameters and stores them in cookies. Your forms pass the data through hidden fields. But now you face a harder question: when a visitor arrives from a Google ad on Monday, returns via an email link on Thursday, and finally converts through an organic search on Saturday — which source gets credit for the lead?
The answer depends on your attribution model. And if you pick the wrong one — or worse, don’t think about it at all — you’ll end up cutting the campaigns that actually fill your pipeline while doubling down on the ones that merely close what other campaigns started.
This guide covers the attribution decisions every WordPress site owner needs to make: first-touch vs last-touch, how long cookies should persist, what a conversion window is, what happens when visitors return with different UTM parameters, and why Safari quietly breaks all of it. We’ll explain each concept, show the JavaScript implementation, and give you clear recommendations based on your business type.
First-Touch vs Last-Touch Attribution: What Each Model Credits
Before writing any code, you need to understand the two fundamental attribution models and what each one tells you.
First-Touch Attribution
First-touch attribution gives 100% of the credit to the first marketing interaction that brought the visitor to your site. If someone first discovered your business through a Facebook ad three weeks ago, first-touch attribution credits Facebook — regardless of how many other channels they interacted with before converting.
What it tells you: Which campaigns and channels are generating awareness and bringing new visitors into your funnel. First-touch answers the question: “How do people discover us?”
Best for: Businesses focused on top-of-funnel growth, brand awareness campaigns, and demand generation. If you’re a new business trying to figure out which channels bring in the most prospects, first-touch is essential.
Last-Touch Attribution
Last-touch attribution gives 100% of the credit to the final marketing interaction before the conversion. If someone originally arrived via a Facebook ad but ultimately converted after clicking an email link, last-touch credits the email.
What it tells you: Which campaigns and channels are directly driving conversions. Last-touch answers the question: “What closes the deal?”
Best for: Businesses focused on conversion optimisation, bottom-of-funnel campaigns, and performance marketing. If you need to know which specific touchpoint triggers the form submission, last-touch shows you.
A Real-World Example
Consider a B2B SaaS company. A marketing director visits your site through these touchpoints over three weeks:
- Week 1: Clicks a LinkedIn ad (
utm_source=linkedin&utm_medium=paid_social&utm_campaign=saas-demo). Reads your homepage, leaves. - Week 2: Searches Google for your brand name, clicks the organic result. Reads a case study, leaves.
- Week 3: Opens your nurture email, clicks through (
utm_source=newsletter&utm_medium=email&utm_campaign=march-nurture). Fills out the demo request form.
First-touch attribution credits LinkedIn — it’s what started the relationship. Last-touch attribution credits the email — it’s what triggered the conversion. Both are valid perspectives. The problem is that most WordPress setups only capture one.
Why You Should Capture Both (And How to Do It)
The mistake most WordPress sites make is choosing one model and ignoring the other. Without first-touch data, your upper-funnel campaigns look like they’re not working. Brand awareness ads on LinkedIn or Facebook generate visits that convert later through other channels — but if you only measure last-touch, you’ll cut the campaigns that actually fill your pipeline.
Without last-touch data, you can’t optimise the bottom of your funnel. You can’t tell which email sequence, retargeting ad, or landing page variant is actually driving form submissions.
The solution is to capture both by using two sets of cookies with different update logic.
The Dual-Capture Cookie Pattern
The concept is simple. When a visitor arrives with UTM parameters:
- First-touch cookies (prefixed with
ft_) are written only if they don’t already exist. Once set, they’re never overwritten. They preserve the original source. - Last-touch cookies (prefixed with
lt_) are always overwritten with the latest values. They always reflect the most recent campaign interaction.
Here’s the JavaScript implementation:
(function() {
var EXPIRY = 7776000; // 90 days in seconds
var PARAMS = [
'utm_source', 'utm_medium', 'utm_campaign',
'utm_term', 'utm_content',
'gclid', 'fbclid', 'msclkid', 'li_fat_id', 'ttclid'
];
function getCookie(name) {
var match = document.cookie.match(
new RegExp('(^| )' + name + '=([^;]+)')
);
return match ? decodeURIComponent(match[2]) : '';
}
function setCookie(name, value) {
document.cookie = name + '=' + encodeURIComponent(value)
+ ';max-age=' + EXPIRY
+ ';path=/;SameSite=Lax';
}
var search = new URLSearchParams(window.location.search);
// Check if the current URL has any tracking parameters
var hasTrackingParams = false;
PARAMS.forEach(function(p) {
if (search.has(p)) hasTrackingParams = true;
});
if (hasTrackingParams) {
PARAMS.forEach(function(p) {
var value = search.get(p) || '';
// Last-touch: always overwrite
setCookie('lt_' + p, value);
// First-touch: only set if no existing cookie
if (!getCookie('ft_' + p)) {
setCookie('ft_' + p, value);
}
});
}
// Landing page and referrer (first-touch only)
if (!getCookie('ft_landing_page')) {
setCookie('ft_landing_page', window.location.href);
setCookie('ft_referrer', document.referrer || '(direct)');
}
// Last-touch landing page (updates every session with UTMs)
if (hasTrackingParams) {
setCookie('lt_landing_page', window.location.href);
setCookie('lt_referrer', document.referrer || '(direct)');
}
})();
This script is an extension of the basic UTM capture snippet covered in our JavaScript tracking guide. The key differences are the ft_ and lt_ prefixes and the conditional write logic for first-touch cookies.
Adding Both Sets of Hidden Fields to Your Forms
With dual-capture cookies in place, you need two sets of hidden fields in your forms — one for first-touch values and one for last-touch values. Here’s how this looks in each major form plugin:
Contact Form 7:
[hidden ft_utm_source default:get]
[hidden ft_utm_medium default:get]
[hidden ft_utm_campaign default:get]
[hidden lt_utm_source default:get]
[hidden lt_utm_medium default:get]
[hidden lt_utm_campaign default:get]
Since these values come from cookies (not the URL), you’ll also need a small JavaScript snippet to populate the hidden fields from the cookie values on form load. This is covered in detail in our Contact Form 7 UTM tracking guide.
Gravity Forms: Create two groups of hidden fields — one set for first-touch (ft_utm_source, ft_utm_medium, ft_utm_campaign) and one for last-touch (lt_utm_source, lt_utm_medium, lt_utm_campaign). Use the gform_field_value filters to populate them from cookies. Full implementation is in our Gravity Forms UTM tracking guide.
WPForms: Add two sets of hidden fields with labels matching the cookie names. The JavaScript DOM-targeting approach covered in our WPForms UTM tracking guide reads the cookie values and writes them into the hidden field inputs on page load.
Choosing the Right Model for Your Business
While capturing both models is ideal, your business type determines which model you should prioritise when making marketing decisions. Use this table as a starting point:
| Business Type | Primary Model | Why |
|---|---|---|
| E-commerce (low-ticket) | Last-touch | Short sales cycle — the final click before purchase is the most actionable signal for optimising ad spend. |
| E-commerce (high-ticket) | Both equally | Longer consideration period — first-touch shows what starts the research; last-touch shows what closes the sale. |
| Local service business | First-touch | Most leads convert on first or second visit. First-touch tells you which channel is generating those leads. |
| B2B lead generation | First-touch (for pipeline), last-touch (for conversion optimisation) | Long sales cycles. First-touch reveals which channels fill the top of funnel. Last-touch shows what nurtures leads to the demo request. |
| SaaS / subscription | Both equally | Multi-touch journeys are the norm. You need to know what generates trials AND what converts them to paid. |
| Content / media | Last-touch | Revenue comes from conversions (subscriptions, ad clicks). Last-touch shows which content piece or referral source drove the monetisable action. |
If you’re unsure, start with both and make decisions based on the data. After three months of dual-capture tracking, you’ll see patterns that tell you which model is more useful for your specific situation.
How Long Should Your UTM Cookie Persist?
Cookie duration is one of the most important decisions in your attribution setup — and one that most WordPress site owners never consciously make. The default in many tutorials and plugins is 30 days, but that’s an arbitrary number that may not match your business.
The principle is simple: your cookie duration should match or exceed your typical time-to-conversion. If your average lead takes 45 days from first visit to form submission, a 30-day cookie will lose attribution for every lead that takes longer than a month. Your reports will show those leads as “direct” — which tells you nothing.
Cookie Duration by Business Type
| Business Type | Typical Time-to-Conversion | Recommended Cookie Duration |
|---|---|---|
| E-commerce (impulse buy) | Same session — 3 days | 7 days |
| E-commerce (considered purchase) | 3 — 14 days | 30 days |
| Local service business | 1 — 7 days | 14 — 30 days |
| SaaS free trial | 7 — 30 days | 30 — 60 days |
| B2B lead generation | 14 — 60 days | 60 — 90 days |
| Enterprise / high-ticket B2B | 30 — 180 days | 90 — 180 days |
In the JavaScript UTM capture script, cookie duration is controlled by the EXPIRY variable (in seconds). Here are the common values:
var EXPIRY = 604800; // 7 days
var EXPIRY = 2592000; // 30 days
var EXPIRY = 7776000; // 90 days (recommended default)
var EXPIRY = 15552000; // 180 days
We recommend 90 days as the default for most WordPress lead generation sites. Here’s why: it aligns with Google Analytics 4’s default conversion window (90 days for non-acquisition conversions), it covers the full sales cycle for most B2B and considered-purchase scenarios, and the marginal privacy impact of 90 days vs 30 days is negligible for first-party cookies.
Aligning with Ad Platform Conversion Windows
Your UTM cookie duration should also consider the default attribution windows of the ad platforms you use. If your cookie expires before the ad platform’s conversion window, your internal reports and the ad platform’s reports will disagree — making it impossible to reconcile the data.
| Ad Platform | Default Conversion Window | Your Cookie Should Be At Least |
|---|---|---|
| Google Ads | 30 days (click-through) | 30 days |
| Meta (Facebook/Instagram) | 7 days (click), 1 day (view) | 7 days |
| LinkedIn Ads | 90 days | 90 days |
| Microsoft Ads | 30 days | 30 days |
| TikTok Ads | 28 days | 28 days |
| Google Analytics 4 | 90 days | 90 days |
If you’re running LinkedIn Ads (90-day window) and your cookie expires after 30 days, LinkedIn will report conversions that your WordPress tracking missed — and you’ll have no way to see which specific lead came from which LinkedIn campaign.
The Lookback Window: What It Is and How to Set It
The term “lookback window” (sometimes called “attribution window” or “conversion window”) refers to the period of time during which a visitor’s conversion can be attributed back to a specific campaign or touchpoint.
In enterprise analytics tools like Google Analytics 4, Mixpanel, or HubSpot, the lookback window is a setting you configure in the platform. But on a self-hosted WordPress site where you’re managing your own cookies, your lookback window is your cookie duration. They’re the same thing.
Here’s why that matters: if your cookie expires after 30 days and a visitor converts on day 31, the cookie is gone. Your form will submit with blank UTM fields. The lead appears as “direct” — you’ve lost the attribution. Your lookback window was effectively 30 days whether you intended it or not.
This is why we recommend starting with a 90-day cookie duration. It gives you a 90-day lookback window by default — long enough to capture most multi-session conversion journeys without being unreasonably long for privacy purposes.
What Happens When Visitors Return with Different UTM Parameters
This is the question that trips up most implementations. A visitor arrives via a Google ad on Monday. Two weeks later, they click an email link. A week after that, they search organically and convert. What should your cookies contain at the point of conversion?
The dual-capture approach we described above handles this cleanly. But the edge cases matter, so let’s walk through them.
Scenario 1: Return Visit WITH New UTM Parameters
Visitor arrives via Google Ads on Day 1, returns via email on Day 14. Both visits have UTM parameters.
| Cookie | After Day 1 (Google Ads) | After Day 14 (Email) |
|---|---|---|
ft_utm_source | google (unchanged) | |
ft_utm_medium | cpc | cpc (unchanged) |
ft_utm_campaign | spring-sale | spring-sale (unchanged) |
lt_utm_source | newsletter (updated) | |
lt_utm_medium | cpc | email (updated) |
lt_utm_campaign | spring-sale | march-nurture (updated) |
The first-touch cookies preserve the original Google Ads data. The last-touch cookies update to reflect the most recent email campaign. When the visitor submits a form, both sets of data are included.
Scenario 2: Return Visit WITHOUT UTM Parameters (Direct or Organic)
Visitor arrives via Google Ads on Day 1, returns by typing the URL directly on Day 14. No UTM parameters in the return visit URL.
In this case, the script does nothing — because the hasTrackingParams check returns false. Both ft_ and lt_ cookies retain their existing values from the Google Ads visit.
This is the correct behaviour. A direct return visit doesn’t represent a new marketing touchpoint — the visitor simply remembered your URL or used a bookmark. Overwriting the last-touch cookies with blank values would destroy useful attribution data. You only update last-touch cookies when the visitor arrives with actual tracking parameters, indicating they came through a specific campaign.
Scenario 3: Return Visit from Organic Search
Visitor arrives via Google Ads on Day 1, returns via organic Google search on Day 14 (no UTMs — organic clicks don’t carry UTM parameters). The same rule applies: since there are no UTM parameters in the URL, the script does nothing. Both cookie sets retain the Google Ads data.
If you want organic search to be captured as a touchpoint, you’d need to detect the referrer and write it as a separate data point. The basic tracking script already captures the referrer URL in the referrer cookie — but it doesn’t overwrite UTM data with inferred organic data. This is by design: UTM cookies should only be updated by explicit UTM parameters, not inferred channel data.
Session Storage vs Cookies: Choosing the Right Persistence Layer
Not every site needs 90-day cookies. Some business models benefit from shorter persistence. Here’s a comparison of the four main storage options:
| Storage Method | Persists Across Pages | Persists Across Sessions | Safari ITP Impact | Best For |
|---|---|---|---|---|
sessionStorage | Yes | No — cleared when browser tab closes | No limit (session-only) | Same-session conversions (e-commerce checkout, simple forms) |
Session cookie (no max-age) | Yes | No — cleared when browser closes | No limit (session-only) | Same-session conversions with server-side access |
| Persistent cookie (30-day) | Yes | Yes | Capped at 7 days on Safari | E-commerce, local services, short sales cycles |
| Persistent cookie (90-day) | Yes | Yes | Capped at 7 days on Safari | B2B, SaaS, long consideration periods |
The critical row in this table is the Safari ITP column. Regardless of whether you set your cookie to 30 days or 90 days, Safari’s Intelligent Tracking Prevention caps JavaScript-set cookies at 7 days. This affects roughly 30% of web traffic globally — and significantly more on mobile.
Safari’s ITP and the 7-Day Cookie Problem
Since 2019, Safari’s Intelligent Tracking Prevention (ITP) has limited all cookies set via JavaScript (document.cookie) to a maximum of 7 days. This means that even if your script sets a 90-day cookie, Safari will delete it after 7 days of inactivity.
The impact on UTM tracking is severe. Here’s the scenario:
- A visitor clicks your Google Ad on Monday. Your script stores
utm_source=googlein a cookie. - They don’t return for 10 days.
- On Day 10, they come back via direct navigation and submit your form.
- Safari deleted the cookie on Day 8. The UTM fields are blank. Google Ads gets zero credit.
For businesses with sales cycles shorter than 7 days, this may not matter. But for B2B companies, SaaS products, or any business where the typical visitor takes more than a week to convert, ITP silently destroys attribution accuracy for a significant percentage of your traffic.
How Big Is the Impact?
A rough calculation: if 30% of your traffic uses Safari and your average time-to-conversion is 14 days, you’re losing attribution data for approximately 30% of the leads that take longer than a week to convert. Those leads show up in your form entries with blank UTM fields — categorised as “direct” or “unknown” — even though they originally came from a tracked campaign.
Workarounds Available to WordPress Site Owners
The enterprise solutions to ITP (server-side Google Tag Manager, reverse proxy setups, CNAME cloaking) require DevOps resources that most WordPress sites don’t have. Here are the practical options:
Option 1: Accept the limitation. If your sales cycle is under 7 days, ITP doesn’t affect you meaningfully. Set your cookies and move on.
Option 2: Server-side cookie setting via PHP. Cookies set via an HTTP Set-Cookie response header (i.e., server-side, not JavaScript) are not subject to the 7-day ITP cap. You can create a small WordPress plugin or functions.php snippet that reads UTM parameters from the URL on the first page load and sets cookies via PHP’s setcookie() function:
add_action('init', function() {
$params = ['utm_source', 'utm_medium', 'utm_campaign',
'utm_term', 'utm_content', 'gclid', 'fbclid',
'msclkid', 'li_fat_id', 'ttclid'];
$hasTracking = false;
foreach ($params as $p) {
if (isset($_GET[$p])) {
$hasTracking = true;
break;
}
}
if ($hasTracking) {
foreach ($params as $p) {
$value = isset($_GET[$p])
? sanitize_text_field($_GET[$p]) : '';
// Last-touch: always set
setcookie('lt_' . $p, $value, [
'expires' => time() + 7776000,
'path' => '/',
'secure' => true,
'httponly' => false,
'samesite' => 'Lax'
]);
// First-touch: only if not already set
if (!isset($_COOKIE['ft_' . $p])) {
setcookie('ft_' . $p, $value, [
'expires' => time() + 7776000,
'path' => '/',
'secure' => true,
'httponly' => false,
'samesite' => 'Lax'
]);
}
}
}
}, 1);
Important caveat: This server-side approach has a conflict with page caching. If your site uses a caching plugin, the first visitor’s cookies get baked into the cached response. Subsequent visitors receive the wrong cookie values. See our guide to WordPress UTM stripping for detailed cache-related fixes.
The recommended approach: use server-side cookies for persistence AND client-side JavaScript for reading values into form fields. The server-side PHP sets the long-lived cookies (immune to ITP). The client-side JavaScript reads those cookies and populates hidden form fields (unaffected by caching because it runs in the browser).
Option 3: Use a plugin that handles this automatically. LeadSourcePro captures attribution data server-side and stores it in the WordPress database, bypassing both ITP cookie limits and page caching issues. More on this below.
Beyond Two Touches: When Multi-Touch Attribution Makes Sense
First-touch and last-touch are “single-touch” models — they each assign 100% of the credit to one touchpoint. Multi-touch attribution models distribute credit across multiple touchpoints in the customer journey.
The most common multi-touch models are:
| Model | How It Distributes Credit | When It Makes Sense |
|---|---|---|
| Linear | Equal credit to every touchpoint | You want a simple view of all contributing channels |
| U-shaped (position-based) | 40% to first touch, 40% to last touch, 20% split across middle | You value both discovery and conversion but want to give less weight to middle touches |
| Time-decay | More credit to touchpoints closer to conversion | You want to emphasise recency without ignoring earlier touches |
| W-shaped | 30% to first touch, 30% to lead creation, 30% to opportunity creation, 10% split across rest | B2B with a defined MQL → SQL pipeline |
The honest truth for most WordPress sites: multi-touch attribution requires capturing every touchpoint (not just the first and last), storing a complete interaction history, and running the attribution model across that history at conversion time. This is what enterprise tools like Google Analytics 4, HubSpot, and Mixpanel do — but they require either significant configuration or a paid plan.
For most WordPress lead generation sites, dual-capture (first-touch + last-touch) is the practical sweet spot. It gives you 80% of the insight for 20% of the complexity. You know what starts the journey and what finishes it. If you find that you need full multi-touch data, that’s typically the point where you upgrade to an analytics platform or a dedicated attribution plugin.
Common Mistakes in Attribution Cookie Setup
After publishing guides on hidden field population, JavaScript UTM capture, and form-specific tracking for Contact Form 7, Gravity Forms, and WPForms, we’ve seen these mistakes repeatedly:
1. Using Session Storage Instead of Cookies
sessionStorage is cleared when the browser tab closes. If a visitor arrives via your ad, browses for a few minutes, closes the tab, and returns the next day to convert — the session storage data is gone. Unless your conversion always happens in a single session, use cookies.
2. Setting Cookie Duration Too Short
A 24-hour or 7-day cookie might seem “privacy-friendly,” but if your average visitor takes 14 days to convert, you’re throwing away attribution data for every lead that doesn’t convert immediately. Match cookie duration to your sales cycle.
3. Overwriting First-Touch Data with Last-Touch
The most common mistake: using a single set of cookies without the ft_/lt_ separation. When a visitor returns with new UTM parameters, the original source data is permanently lost. You’ll know which channel closed the lead but not which channel generated it.
4. Clearing Last-Touch Cookies on Direct Visits
Some implementations reset last-touch cookies to “direct” when a visitor returns without UTM parameters. This destroys valid attribution — the visitor simply bookmarked the page or typed the URL. Only update last-touch cookies when new UTM parameters are present.
5. Ignoring Click IDs in Attribution
UTM parameters tell you the campaign. Click IDs (gclid, fbclid, msclkid, li_fat_id, ttclid) link the lead back to the specific ad click in the platform. If you’re tracking UTMs but not click IDs, you can’t close the loop between your WordPress form entries and your ad platform’s conversion reporting. Our click ID tracking guide covers all five platforms.
How LeadSourcePro Handles Attribution Automatically
Everything described in this guide — dual-capture cookies, first-touch and last-touch tracking, cookie duration configuration, Safari ITP workarounds, hidden field population — is what LeadSourcePro automates out of the box.
When you install LeadSourcePro:
- Both attribution models are captured automatically. First-touch and last-touch UTM data is stored for every visitor without any code or configuration.
- Cookie duration is configurable. Set it to 30, 60, 90, or 180 days from the plugin settings. The default is 90 days.
- Safari ITP is handled server-side. LeadSourcePro stores attribution data in the WordPress database, not just in browser cookies. The data persists regardless of browser cookie restrictions.
- Form fields are populated automatically. LeadSourcePro integrates with Contact Form 7, Gravity Forms, WPForms, and other major form plugins — no hidden field setup required.
- Click IDs are captured alongside UTMs. Google, Meta, Microsoft, LinkedIn, and TikTok click IDs are all tracked and stored with each lead.
- Returning visitors are handled correctly. The overwrite logic is built in — first-touch is preserved, last-touch is updated, and direct visits don’t destroy attribution data.
| Feature | Manual JavaScript | LeadSourcePro |
|---|---|---|
| First-touch tracking | Requires dual-capture code | Automatic |
| Last-touch tracking | Requires dual-capture code | Automatic |
| Cookie duration control | Edit the EXPIRY variable | Plugin settings dropdown |
| Safari ITP bypass | Requires server-side PHP code | Built-in server-side storage |
| Click ID tracking | Must add each ID to the script | All 5 platforms included |
| Form integration | Custom code per form plugin | Automatic for all supported plugins |
| Maintenance | Update code when requirements change | Plugin updates handle changes |
Putting It All Together: The Attribution Setup Checklist
Whether you’re implementing attribution manually or using a plugin, here’s the checklist of decisions you need to make:
| Decision | Options | Recommendation |
|---|---|---|
| Attribution model | First-touch only, last-touch only, or both | Capture both — use the decision table above to prioritise for reporting |
| Cookie duration | 7 / 30 / 60 / 90 / 180 days | 90 days (matches GA4 conversion window) |
| Storage method | sessionStorage, session cookie, persistent cookie, server-side | Persistent cookie + server-side for Safari ITP bypass |
| Parameters to track | UTMs only, UTMs + click IDs, UTMs + click IDs + referrer + landing page | All of the above — capture everything, decide what to use later |
| Overwrite logic for returning visitors | Always overwrite, never overwrite, conditional (only when new UTMs present) | Conditional — preserve first-touch, update last-touch only when new UTMs arrive |
| Safari ITP handling | Accept the 7-day limit, server-side PHP cookies, or plugin-based | Server-side PHP if your sales cycle exceeds 7 days |
Frequently Asked Questions
Should I use first-touch or last-touch attribution?
Capture both. First-touch tells you which channels generate awareness and bring new visitors. Last-touch tells you which channels drive conversions. Using only one model gives you half the picture. The dual-capture JavaScript pattern shown above stores both without any extra complexity at the form level — you just add two sets of hidden fields instead of one.
What happens to my cookies when a visitor clears their browser data?
All cookies are deleted, including your UTM tracking cookies. There’s no way to prevent this — it’s a user-initiated action that browsers enforce. The practical impact is small: research suggests around 10-30% of users periodically clear cookies, but most of those users also clear cookies on sites they don’t regularly visit. For your active prospects who are actively considering your product, the clear rate is much lower. Server-side storage (via a plugin like LeadSourcePro) provides a more durable alternative because the data is stored in your WordPress database, not in the browser.
Does GDPR require consent for UTM tracking cookies?
UTM tracking cookies are first-party cookies used for marketing attribution. Under GDPR, they typically fall under “marketing” or “analytics” cookies and require consent in the EU. If your site serves EU visitors, integrate your UTM cookie script with your consent management platform (CookieYes, Complianz, etc.) so that cookies are only set after the visitor grants consent. Note that this means EU visitors who decline cookies will have no attribution data — a trade-off you need to accept.
Can I set different cookie durations for first-touch and last-touch?
Yes. Some implementations use a longer duration for first-touch cookies (e.g., 180 days) and a shorter one for last-touch (e.g., 30 days). The logic: first-touch data is harder to recover if lost (you can’t go back in time to find the original source), while last-touch data refreshes with every new campaign interaction. In the dual-capture script above, you’d use two different EXPIRY values — one for the ft_ setCookie calls and another for the lt_ calls.
How do I see first-touch and last-touch data in my form entries?
Each form plugin has its own way of displaying hidden field data. In Gravity Forms, both sets appear as fields in the entry detail view. In Contact Form 7, they’re included in the notification email (add the [ft_utm_source] and [lt_utm_source] tags to your email template). In WPForms, they appear in the entry view if you have WPForms Pro. For all plugins, you can also export entries to CSV and analyse attribution data in a spreadsheet — filter by ft_utm_source to see which channels generate leads, and by lt_utm_source to see which channels close them.
LeadSourcePro captures both first-touch and last-touch attribution automatically. No code, no hidden fields, no cookie configuration. Install the plugin, and every form submission includes the complete attribution trail — from the first ad click to the final conversion.

Leave a Reply