Lead Attribution: How to Track Every Lead Back to Its Campaign and Ad
How lead tracking works from click to closed deal: UTMs, click IDs, session matching, form capture and CRM revenue per ad. Plus first vs last click and a checklist.
Contents
- What lead attribution has to deliver
- The data chain from click to revenue
- 1. Tag the click
- 2. Store the visit
- 3. Capture the lead
- 4. Match the lead to the session
- 5. Bring deals and revenue back
- An example
- First click or last click for lead generation?
- Why ad accounts and CRM never match
- Lead tracking checklist
- How LeadMetrics helps
Meta reports 48 leads, Google Ads 31, and your CRM has 62 inquiries with no recognizable source. Which ad brought which lead, and which of them later became a customer? That's the question lead attribution answers. This guide is for performance marketers, agencies and lead generation businesses. By the end you'll know how to attribute every lead to its campaign, ad set and ad, which building blocks have to work together, when first click and when last click is the right view, and why ad platform numbers never quite match your CRM.
What lead attribution has to deliver
Lead tracking means more than counting form submissions. For every inquiry you want to answer three questions:
- Where did the lead come from? Channel, campaign, ad set and ad.
- What happened to it? Qualified, meeting booked, deal won or lost, revenue.
- What did it cost? Ad spend per lead, per closed deal and relative to revenue.
The ad platforms only answer part of this. They see their own clicks and whatever their pixel captures on your website. They don't see what happens in your CRM, and they know nothing about ads on other networks. That's why your own attribution doesn't start in the ad account, but on your website, where click and lead meet.
The data chain from click to revenue
For a lead to end up with the right ad, five links have to hold. If one breaks, the lead shows up as "direct" or "unknown".
1. Tag the click
Every ad needs URL parameters that say where the visit came from. UTM parameters give you the readable view (utm_source, utm_campaign, utm_content), while click IDs such as gclid, fbclid, ttclid or li_fat_id identify the individual click for the platform. To attribute down to the ad level, dynamic parameters matter, such as {{ad.id}} in Meta or {creative} in Google Ads. Names change when someone renames a campaign, IDs stay stable. How to set this up is covered in the guide on clean campaign tracking.
2. Store the visit
UTMs and click IDs are only in the URL on the first page view. A tracking script has to read them during the visit and store them in a session, usually with first-party cookies. That's the only way the source survives when someone converts three pages later or on a second visit a week later.
3. Capture the lead
When the form is submitted, the lead has to be connected to the session. There are two ways:
- Session ID in the form: A hidden field sends the session identifier along with the form data. This is the most precise match.
- Matching on contact details: The tracking detects the email address or phone number in the form and stores it on the session. When the lead arrives later by webhook or from the CRM, it's found that way.
It gets tricky when the form sits in an iframe, runs on a different domain or leads into a checkout. How to connect funnel builders, booking tools and checkout pages is explained in the guide on cross-domain tracking for funnels and iframes.
4. Match the lead to the session
Now the lead is linked to its visit. Robust matching works in a fixed order: session ID first, then email address, then phone number. A long enough lookback period is important. In real estate or B2B, weeks can pass between the first click and the inquiry. And leads that can't be matched right away should be matched again later, because data doesn't always arrive in the right order.
5. Bring deals and revenue back
A lead is not a customer yet. Revenue happens later in your CRM or payment provider. For it to land with the right ad, the deal has to be traced back to the original lead via email address, phone number or an ID. Only then do you see cost per acquisition and ROAS per ad, and only then can you send closed deals back to Meta, Google Ads, TikTok or LinkedIn as offline conversions. How to measure real ROAS from there is covered in the guide on lead generation from click to closed deal.
An example
An insurance broker runs two Meta campaigns and one Google search campaign, 5,000 € per month in total.
| Meta campaign A | Meta campaign B | Google Search | |
|---|---|---|---|
| Leads per ad account | 41 | 22 | 28 |
| Leads attributed by click | 30 | 18 | 24 |
| Deals won | 2 | 5 | 4 |
| Revenue | 3,000 € | 9,500 € | 6,800 € |
Going by the ad account, campaign A is the winner. With your own attribution down to the deal, campaign B is clearly ahead: fewer leads, but more than twice as many closed deals. Without this chain, the budget would flow into the wrong campaign.
First click or last click for lead generation?
If someone comes back several times through different ads, the attribution model decides who gets the lead.
| First-click attribution | Last-click attribution | |
|---|---|---|
| Lead goes to | the first click | the last click before the inquiry |
| Answers | Which campaign brings in new prospects? | Which campaign triggers the inquiry? |
| Favors | Prospecting, video, social | Retargeting, brand search, reminders |
| Good for | Budget for acquiring new customers | Optimizing the last steps of the funnel |
A typical pattern in lead generation: someone sees a Meta ad, clicks, looks around and searches for your brand on Google three days later. With last click, Google brand search gets the lead, with first click the Meta campaign. If you only look at last click, you'll quickly cut the budget of the campaigns that created the demand in the first place.
Our recommendation: look at both views. If they're close, the journey is short and the decision is easy. If they differ a lot, campaigns at the start of the journey are doing more than last click shows. Models such as multi-touch attribution split the lead across several contacts, but they assume that every touchpoint is actually captured. In lead generation that's rarely the case, and two clear views are often more useful.
Why ad accounts and CRM never match
Even with perfect lead tracking, platform numbers will be higher than your own. The main reasons:
- Views and engagements count too: Meta, Google and TikTok also credit themselves with leads after a plain view or an engagement without a click. Website tracking only sees clicks.
- Double counting: If the same person saw ads on Meta and Google, both platforms count the lead.
- Different attribution windows: Google Ads uses 30 days after the click by default, Meta 7 days.
- Modeled conversions: Without consent, platforms partly fill their numbers with estimates.
- Lost parameters: Redirects, cookie banners or iframes strip click IDs, and the lead doesn't show up in any account.
For the question "how many leads and customers did each campaign bring?", your own attribution is the reference, not the ad account. How to reconcile the numbers anyway is covered in the guide on attribution windows.
Lead tracking checklist
Parameters in every ad
All active ads carry UTMs with campaign, ad set and ad ID. Auto-tagging is on in Google Ads.Tracking on every page
The tracking script runs on the landing page, form pages, thank-you pages and all funnel domains.Redirects tested
A test visit with?utm_source=test&gclid=teststill shows the parameters after every redirect and after the cookie banner.Forms connected
Every form passes on a session ID or an email address or phone number, including in iframes, funnel builders and booking tools.Test lead submitted
One test lead per form shows up with channel, campaign and ad in your reporting.CRM connected
Deals and payments are matched to the original lead automatically, not by hand in a spreadsheet.Model agreed
The team knows whether you report by first click or last click, and the model doesn't change in the middle of an analysis.Signals sent back
Leads and won deals go to the ad platforms via the Conversion API so they optimize for customers instead of form fills.Check weekly
The share of leads without a source is reviewed regularly. If it jumps, something changed on the website, a form or the ads.
How LeadMetrics helps
LeadMetrics covers the whole chain from click to revenue (lead tracking & attribution):
- One script for all channels: It captures sessions, visits and page views with their traffic source, meaning LeadMetrics' own ad parameters, UTMs and click IDs. Sessions last 90 days with consent and 1 day without.
- Automatic matching: Leads are matched to their session by session ID, email address or phone number, up to 90 days back. Unmatched leads are re-checked every hour.
- Form detection: Email and phone number from form fields are transmitted encrypted, including in single-page apps. For iframes, funnel builders and checkouts there are placeholders and redirects.
- CRM and payments: Deals from HubSpot and Close and payments from Stripe, CopeCart and Digistore24 land with the right lead. You can connect other sources via Zapier, Make or your own webhooks.
- Drill down to the ad: Dashboards show leads, deals, cost per acquisition, revenue and ROAS per channel, campaign, ad set and ad, with a switch between first click and last click. Each lead has a journey timeline and click history.
- Conversion API: Leads, purchases and won deals go to Meta, Google Ads, TikTok and LinkedIn with value, hashed contact details and click IDs.
Ready for better tracking?
Frequently asked questions
Terms in this guide
All termsAttribution · Assigning conversions to marketing channels
Attribution assigns leads, purchases and revenue to the channels, campaigns and ads that drove them – the basis for every budget decision you make.
First-Click Attribution · The attribution model that credits the first contact
First-click attribution gives 100% of the credit for a conversion to the first touchpoint – the channel through which a user found you for the first time.
Last-Click Attribution · The attribution model that credits the last contact
Last-click attribution gives 100% of the credit for a conversion to the last touchpoint before it – the click that led directly to the lead or purchase.
UTM Parameters
UTM parameters are tags added to a URL (e.g. utm_source, utm_campaign) that tell analytics tools which source and campaign a visitor came from.
gclid · Google Click Identifier
The gclid is the Google Click ID that Google Ads adds to your URL on every ad click, e.g. ?gclid=EAIaIQobChMI... What it means, why it is missing and how to use it.
fbclid · Facebook Click Identifier
The fbclid is the Facebook Click ID Meta adds to links from Facebook and Instagram, e.g. ?fbclid=IwAR2... What it means, whether you can remove it and how it is used.
CRM · Customer Relationship Management
A CRM (customer relationship management) is a system for managing contacts, leads, deals and all communication with prospects and customers in one place.
Offline Conversions · Reporting deals that happen off your website back to ad platforms
Offline conversions are conversions that don’t happen on your website – like a closed deal in your CRM – and are sent back to ad platforms like Meta.
Related articles
- From CRM Lead to Real Conversion: No More Flying Blind in Performance MarketingHow CRM/AdSync makes the true value of your campaigns visible – and why it's the game-changer for data-driven growth.
- Meta Attribution in 2026: What Engage-Through Means and Why Conversions Are MissingSince March 2026, Meta only counts link clicks as clicks, while likes and saves count as engage-through. Two view windows are gone, too. What changed and how to read your numbers correctly.
- Conversion APIs for Lead Generation: Meta, Google, TikTok and LinkedIn ComparedAll major ad platforms now accept leads and deals server-side, but each one differently. Match keys, click IDs, lead events, time limits and deduplication for Meta, Google Ads, TikTok and LinkedIn at a glance, as of October 2026.
- Measuring Incrementality: Do Your Ads Really Bring Additional Leads?Google has opened Conversion Lift studies for Search and Performance Max without a Google rep. What incrementality means, why attribution doesn't show it and how to check it in lead generation, even with low volume.
- Client-Side vs. Server-Side Tracking: Differences, Pros and Cons for Lead GenerationClient-side vs server-side tracking: how both work, how they differ on ad blockers, cookies, privacy and data quality, and why lead gen setups combine the two.
More guides
All guidesUnderstanding Attribution Windows: Why Meta, Google and Your CRM Never Show the Same Numbers
How attribution windows work on Meta, Google Ads, TikTok and LinkedIn, why platform numbers don't match your CRM and how to reconcile them properly.
Read guideClient Reporting for Agencies: How to Automate Marketing Reports for Lead Generation
Which KPIs belong in a client report for lead campaigns, how to structure a monthly report and how to automate data collection and delivery. With template and checklist.
Read guideCross-Domain Tracking for Funnels, Iframes and Checkouts: Don't Lose a Single Lead
Why leads from Heyflow, Perspective, Typeform, ClickFunnels, Calendly or Digistore24 lose their source, and how to pass the session across domains, iframes and checkouts.
Read guide