DATALYR

Closed-loop attribution: tie ad spend to won deals

Connect each lead to the campaign that produced it and to what sales did next, separate contract value from cash, and send outcomes back to ad platforms.

By DATALYR · · 4 min read

Contents

What closed-loop attribution means

Closed-loop attribution connects the campaign that produced a lead to what happened to that lead afterwards: qualified, won, paid or lost. The loop closes when those outcomes flow back to where spend is decided, both your reports and the ad platforms' bidding.

Closed-loop reporting is the reporting half of the same idea. Marketing sees which campaigns produced pipeline and customers, and sales sees where its leads came from. Without it, marketing optimizes on leads and sales judges on deals, and neither number explains the other.

Pipeline attribution, account-based attribution and marketing-sourced pipeline are all versions of this loop. They differ in what they count and how they assign credit.

Sourced versus influenced pipeline

Marketing-sourced pipeline usually means opportunities whose first recorded touch was a marketing activity, such as a paid click. Marketing-influenced pipeline usually means opportunities with any marketing touch before the opportunity was created. Teams define both differently, so write the rule beside the number.

Consider one hypothetical account: a LinkedIn ad click in March, an outbound email reply in April and a Google brand search before the demo in May. Under a first-touch sourced rule the deal is LinkedIn-sourced. Under an influenced rule, LinkedIn and Google both influenced it, and summing influenced pipeline across channels counts the deal twice.

Account-based attribution groups several contacts into one company account before assigning credit. It needs a reliable company key in the CRM, such as the account record or email domain, and the same counting rules.

Build the lead-to-cash record

A closed loop needs one record per lead that carries the campaign, each sales stage and, eventually, the payment. Name the stages before wiring anything: lead submitted, call booked, qualified, won. Each stage needs a stable ID so a retry is not counted as a second deal.

The join between the ad click and the CRM is usually the email address. DATALYR's HubSpot and Zapier routes match a stage to the earlier visit by email, which works when the visit was identified on your form, by a Calendly or iClosed booking, or by a payment.

Keep contract value and cash apart. A won deal in HubSpot, Salesforce or any CRM carries a contract value; DATALYR records it as a non-cash fact that never counts as revenue. Cash comes from the payment source, such as Stripe.

The closed loop

1. Ad click

Campaign captured

Click ID and UTMs stored with the visit.

2. Lead and stages

Qualified, won

CRM stages joined to the visit by email.

3. Payment

Cash collected

Billing source records what was actually paid.

4. Back to platforms

Qualified and won conversions

Bidding learns from outcomes, not form fills.

Contract value and cash are separate rows in the same record.

Example: contract value and cash

This is a hypothetical example. A campaign spends $20,000 and produces 200 leads. Sales qualifies 40 and wins 8 deals at an annual contract value of $15,000 each, so won contract value is 8 × $15,000 = $120,000.

The customers pay quarterly. After the first invoices, Stripe has collected 8 × $3,750 = $30,000. Contract value per dollar of spend is $120,000 ÷ $20,000 = 6.0; cash per dollar so far is $30,000 ÷ $20,000 = 1.5.

Both numbers are correct and answer different questions. Contract value tells you what the campaign closed. Cash tells you what it has returned to date. Reporting $120,000 as revenue would overstate the business by $90,000 at this point in the year.

Two honest ratios

Won contract value

$120,000 → 6.0× spend

8 deals × $15,000 annual contract.

Cash collected so far

$30,000 → 1.5× spend

8 first quarterly invoices × $3,750.

Hypothetical campaign with $20,000 spend. Contract value is never revenue.

Send the outcomes back to ad platforms

Reporting closes half the loop. The other half is sending qualified leads and won deals to Meta, Google and LinkedIn so bidding learns from them. Google matches imported outcomes through the stored click ID within 90 days of the click. Meta's Conversions API for CRM covers Instant Form leads, and the standard Conversions API covers website leads.

DATALYR creates the rules from the HubSpot or Zapier card: a qualified lead goes to Meta as Lead, and a won deal goes as Purchase to Meta, CompletePayment to TikTok and your purchase action in Google Ads, with the deal ID as the order ID. Salesforce, Pipedrive and other CRMs use the Zapier route.

Most deals close long after Meta's short attribution window, so optimize Meta on an earlier stage and let the won stage inform reporting and Google bidding.

Verify one lead through the loop

Open your landing page with a test UTM, submit the form with a test email, and move a test deal through each stage. Confirm in DATALYR that the page view and every stage sit on one user, and that the won deal carries the deal amount without appearing in revenue.

Then check each destination's own diagnostics. An accepted upload is not the same as campaign credit, and each platform applies its own windows before it counts a conversion.

Related articles.

See what really drives revenue.

Real-time attribution, analytics and conversions for every channel, campaign and ad, ready for your team and your agents.

Get started