The short answer
To track cost per lead by ad, tag every ad with its ad id in the URL, save that id on each lead, then divide each ad's spend by the leads it brought. Do the same for qualified leads or booked calls, because the cheapest ad on leads is often not the cheapest on customers.
Why by ad, not by campaign
A campaign holds many ads. Some bring cheap leads that never answer the phone, some bring fewer leads that buy. Campaign averages hide that. Cost per lead by ad shows which creative is really working.
Step 1: Tag every ad
Add the platform's dynamic values to each ad's URL so the ad id arrives with the click. Meta uses {{ad.id}}, Google Ads uses {creative}, TikTok uses __CID__, and LinkedIn uses {{CREATIVE_ID}}.
Step 2: Keep the ad id on the lead
Your landing page must save the ad id when the visitor arrives and attach it to the lead when they submit. If the funnel has several steps, it has to survive all of them.
Step 3: Do the math
For each ad, divide spend by leads. Then divide spend by qualified leads, and by booked calls if you book them. Spend comes from the ad platform, leads from your funnel.
Cost per lead = ad spend / leads from that ad
Cost per qualified lead = ad spend / qualified leads from that adStep 4: Act on it
- Scale: Ads with the lowest cost per qualified lead.
- Fix: Ads with cheap leads but few qualified ones: the hook may be attracting the wrong people.
- Cut: Ads with high cost on every measure, once they have spent enough to judge.
How Unfunnel does it
Unfunnel's publish screen gives you the tracking tags for Meta, Google, ChatGPT, TikTok and LinkedIn. Every lead is stored with its campaign, ad set and ad, and the Metrics page shows leads, qualified leads and drop-off by ad.
Build it without code: tracking, ad tags and booking built in. Free to start.
Start for free