Tracking guide

How to track cost per lead by ad

Updated · 2 min read

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 ad

Step 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

Questions

What is a good cost per lead?

It depends on what a customer is worth to you. Work back from it: if one in five leads buys and a customer is worth $1,000, a lead is worth up to $200.

Should I optimise my ads for leads or qualified leads?

If you can fire a separate event for qualified leads, optimising for it often brings better leads, at a higher cost per lead.

Why don't my platform's lead counts match my funnel?

Ad platforms count conversions they can attribute, with their own windows and models. Your funnel counts every lead. Both can be right.

Turn ad clicks into leads you can trace.

Start for free

Start free, no card needed

Paid plans start with a 7-day trial

Start for free