Metric · Marketing

What is cost per lead, and how do you measure it in Metabase?

Cost per lead is spend divided by leads (or other target actions) generated — the efficiency metric for the top of a lead-gen funnel. It sits betweenCPC, which prices attention, and CAC, which prices actual customers. Measure it in Metabase from spend and lead data synced from LinkedIn Ads, Google Ads, and Meta Ads.

TL;DRspend ÷ leads, per channel and campaign, always paired with cost per qualified lead. CPL falling while qualified-lead cost rises means quality dropped — the classic failure mode of optimizing on CPL alone.

What cost per lead measures

It measures how efficiently a channel converts budget into hand-raisers. That makes it the right metric for comparing campaigns within a channel and for spotting creative or audience decay early — lead volume reacts faster than revenue does. It is the wrong metric to optimize in isolation, because platforms will happily deliver cheaper leads by finding people who fill in forms but never buy.

Raw leads vs. qualified leads

A raw lead is a form fill; a qualified lead (MQL or SQL, by whatever your team's definition is) is one that survived a quality check. The two costs move independently: broaden targeting and CPL falls while cost per qualified lead rises, because the extra leads are noise. LinkedIn Lead Gen Forms are the canonical example — prefilled forms make submitting nearly frictionless, so raw volume is high and the qualification step does the real filtering. Connect CPL to downstream conversion so cheap-but-bad channels get caught instead of rewarded.

What data does it need?

  • An ad_performance_daily table with channel, stat_date, spend, and leads as each platform reports them.
  • A CRM leads table with source_channel, created_at, and an is_qualified flag — one lead definition applied to every channel.

SQL patterns

Cost per lead by channel by monthPostgreSQL
SELECT
  channel,
  date_trunc('month', stat_date) AS month,
  SUM(spend) AS spend,
  SUM(leads) AS leads,
  ROUND(SUM(spend) / NULLIF(SUM(leads), 0), 2) AS cost_per_lead
FROM ad_performance_daily
WHERE stat_date >= CURRENT_DATE - INTERVAL '12 months'
GROUP BY 1, 2
ORDER BY 2, 1;
CPL vs. cost per qualified leadPostgreSQL
WITH monthly_spend AS (
  SELECT
    channel,
    date_trunc('month', stat_date) AS month,
    SUM(spend) AS spend
  FROM ad_performance_daily
  GROUP BY 1, 2
),
lead_counts AS (
  SELECT
    source_channel AS channel,
    date_trunc('month', created_at) AS month,
    COUNT(*) AS leads,
    COUNT(*) FILTER (WHERE is_qualified) AS qualified_leads
  FROM leads
  GROUP BY 1, 2
)
SELECT
  s.month,
  s.channel,
  ROUND(s.spend / NULLIF(l.leads, 0), 2) AS cost_per_lead,
  ROUND(s.spend / NULLIF(l.qualified_leads, 0), 2)
    AS cost_per_qualified_lead,
  ROUND(100.0 * l.qualified_leads / NULLIF(l.leads, 0), 1)
    AS qualification_rate_pct
FROM monthly_spend s
JOIN lead_counts l
  ON l.channel = s.channel AND l.month = s.month
ORDER BY 1, 2;

Pitfalls

Optimizing CPL without lead quality.→ Platforms optimize toward whoever converts on the form, not whoever buys. Pair every CPL chart with cost per qualified lead and qualification rate, or budget flows to the channels best at generating noise.
Different lead definitions per channel.→ A LinkedIn Lead Gen Form fill, a gated-PDF download, and a demo request are not the same event. Comparing their CPLs compares definitions, not channels. Normalize on one definition in your own leads table.
Ignoring view-through and spam form fills.→ Bot traffic and view-through-attributed leads inflate the denominator and flatter CPL. Deduplicate by email, filter obvious spam, and count leads from your CRM rather than trusting platform-reported totals.
Comparing CPL across funnel stages.→ A newsletter signup and an SQL-stage demo request can both be "leads" in someone's deck. Cost comparisons only mean something within the same funnel stage — label the stage on the chart.

Where this metric applies

Metrics

Dashboards

FAQ

Cost per lead vs. cost per acquisition — what's the difference?
CPL counts leads — a form fill, a demo request, a trial signup. CPA counts a target action further down the funnel, often a purchase, at which point it converges on CAC. The distinction matters because channels are usually optimized on the shallow event: a channel can win on CPL and lose badly on CPA if its leads never convert. Track both stages of a marketing funnel dashboard so the gap is visible.
What's a good cost per lead?
It varies by market, offer, and lead definition, so cross-company benchmarks mislead more than they help. The useful comparisons are internal: this channel vs. last quarter, this campaign vs. its siblings under the same lead definition. B2B CPLs from LinkedIn Ads routinely run several times higher than Meta Ads — and are often still worth it, because qualification rates differ just as much. Judge CPL only alongside cost per qualified lead.
Why is our CPL falling but pipeline shrinking?
Lead quality dropped. CPL falls when targeting broadens or the offer gets easier to accept — and both pull in people who were never going to buy, so cost per qualified lead rises while CPL falls. Chart the two together with the qualification rate, and connect leads to downstream conversion rate. A channel that halves CPL while its qualification rate collapses got more expensive, not cheaper.
How do you calculate cost per lead?
Divide spend by leads generated in the same period: SUM(spend) / COUNT(leads), per channel and month, with NULLIF guarding zero-lead periods. The load-bearing decision is what counts as a lead — write one definition (which form fills, which events, deduplicated how) and apply it identically to every channel, or the comparison is between definitions rather than channels.
How do you track cost per lead in Metabase?
Sync spend and lead counts from LinkedIn Ads — Lead Gen Forms report leads natively — plus Google Ads and Meta into an ad_performance_daily table, and land your CRM leads with a qualified flag. Chart CPL and cost per qualified lead side by side, and pin them on a paid channel performance dashboard next to landing page conversion rate.