Connecting Ad Spend to Closed Deals: A Practical Attribution Playbook
Connecting Ad Spend to Closed Deals: A Practical Attribution Playbook
The gap between "we spent $X on marketing this quarter" and "we closed $Y in revenue" is the most important gap in B2B marketing. Most teams can tell you the spend. Fewer can tell you the revenue attributable to that specific spend.
This playbook closes that gap. It's a step-by-step implementation guide — not a conceptual overview of attribution models, but the actual steps to connect your Google and LinkedIn spend to your CRM's closed deals report.
TL;DR
- The connection from ad spend to closed deals requires three things: UTMs, CRM field mapping, and a pipeline attribution report
- The most common failure point is UTMs not surviving through the booking tool into the deal record
- The attribution lookback window must match your sales cycle or your data will look worse than reality
- Pipeline ROI (spend vs pipeline generated) is the leading indicator; revenue ROI (spend vs closed-won) is the lagging indicator — use both
- Cogny automates the weekly pipeline-by-campaign report so you always know which channels are generating deals
Phase 1: Instrumentation
Before you can connect ad spend to closed deals, you need data flowing from ads to CRM. This phase is about making sure every step of the journey is tagged and tracked.
1.1 Tag Every Campaign with UTMs
Every ad that could generate a lead needs a UTM-tagged destination URL. No exceptions.
https://cogny.com/ai-agency?utm_source=linkedin&utm_medium=paid-social&utm_campaign=q3-2026-cmo-retargeting&utm_content=attribution-ad-v2
Store your UTM conventions in a shared naming doc. Common problems that arise without a naming convention:
LinkedInvslinkedinvsli— all appear as different sources in reportingQ3-retargetingvsq3-retargetingvsq3_retargeting— all different campaign names- Generic campaign names like
linkedin-campaign-1that tell you nothing in six months
If you have 3+ people managing campaigns, a UTM naming document is not optional.
1.2 Verify UTM Capture at Every Conversion Point
UTMs must land in your CRM. Test this explicitly for every form and booking tool:
Test procedure:
- Create a test URL:
https://your-site.com/contact?utm_source=test&utm_medium=test&utm_campaign=attribution-test-do-not-delete - Open it in an incognito browser
- Complete the form or book a meeting
- Check the CRM contact: does it have UTM campaign =
attribution-test-do-not-delete?
Do this for every conversion point: contact forms, demo request forms, Calendly links, live chat conversion flows, gated content downloads.
Where UTMs commonly leak:
- Redirect chains: Your ad links to a redirect URL that strips query parameters. Fix: link directly to the final URL with UTMs included.
- Booking tools not configured: Calendly, Chili Piper, and HubSpot Meetings require explicit configuration to capture UTM parameters (see How to Track Which Marketing Channel Books Your Sales Calls).
- Forms without hidden fields: Many form builders don't capture UTMs automatically. You need to add hidden fields (utm_source, utm_medium, utm_campaign) that are pre-filled from URL parameters via JavaScript.
- CRM sync delays: HubSpot's UTM capture happens on first page visit, not on form submission. If the Meetings page is hosted on a non-HubSpot subdomain, UTMs may not capture for the booking. Test specifically.
1.3 Map UTM Fields to Deal Records
UTMs captured on Contact records need to transfer to Deal/Opportunity records. Deals are where your revenue lives; attribution on contacts alone doesn't let you run a "pipeline by campaign" report.
HubSpot workflow:
Create a workflow:
- Trigger: Deal is created
- Condition: Associated contact has
utm_campaignproperty set - Action: Set
Deal.Campaign Source=Contact.utm_campaign
Salesforce Flow:
Create an After-Save Flow on the Opportunity object:
- Trigger: Opportunity Created
- Action: Query the Primary Contact record's
UTM_Campaign__cfield - Action: Write the result to
Opportunity.Campaign_Source__c
Test by creating a deal associated with a contact that has known UTM data. Verify the deal immediately shows the campaign source.
Phase 2: Attribution Reporting
With data flowing, build the reports that answer the question.
2.1 The Pipeline Attribution Report
This report answers: "For each campaign, how much pipeline did we generate in the last 90 days?"
In HubSpot (Marketing Hub Professional):
- Reports → Create Report → Sales Report → Deal Revenue Forecast or Deals Created
- Group by: Deal property "Campaign Source" (your custom field)
- Date range: Last 90 days (deal created date)
- Metrics: Count (deals), Sum of Deal Amount, Sum of Closed-Won Amount
In Salesforce:
Create a Campaign with Influenced Opportunities report:
- Reports → New Report → Campaigns with Influenced Opportunities
- Add filters: Opportunity Created Date = Last 90 days
- Columns: Campaign Name, Influenced Opportunities, Total Influenced Revenue, Won Revenue
- Group by Campaign Name
Manual BigQuery query (if your CRM exports to BQ):
SELECT
COALESCE(d.campaign_source, 'Unknown') as campaign,
COUNT(d.id) as deals_created,
SUM(d.amount) as pipeline_value,
SUM(CASE WHEN d.stage = 'Closed Won' THEN d.amount ELSE 0 END) as closed_won,
SUM(CASE WHEN d.stage = 'Closed Won' THEN d.amount ELSE 0 END) /
NULLIF(SUM(d.amount), 0) * 100 as win_rate_pct
FROM deals d
WHERE d.created_at >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY campaign
ORDER BY pipeline_value DESC
2.2 Adding Ad Spend Data
The pipeline report tells you which campaigns generated deals. To calculate ROI, you need to join in the actual spend by campaign.
Manual approach: Export spend by campaign from each ad platform (LinkedIn Ads → Campaign Manager → export, Google Ads → Reports → export). Create a spreadsheet that joins campaign name, spend, and pipeline data. Calculate:
- Cost per deal created = Spend ÷ Deals created
- Cost per $1 of pipeline = Spend ÷ Pipeline value
- Pipeline ROI = (Pipeline value - Spend) ÷ Spend × 100
- Revenue ROI = (Closed-won - Spend) ÷ Spend × 100
Automated approach (Cogny): Connect your LinkedIn Ads, Google Ads, and CRM to Cogny. The Growth Ticket system pulls spend data from each platform and joins it against CRM pipeline data by campaign name (matched by UTM campaign value). Every Monday morning, you get a report showing:
| Campaign | Spend (last 30d) | Pipeline generated | Pipeline ROI | Closed-Won | Revenue ROI |
|---|---|---|---|---|---|
| q3-cmo-retargeting | $4,200 | $68,000 | 1519% | $28,000 | 567% |
| google-brand-search | $1,800 | $42,000 | 2233% | $15,000 | 733% |
| linkedin-warmup-content | $2,100 | $12,000 | 471% | $5,000 | 138% |
2.3 Setting the Right Lookback Window
The most common attribution mistake: running a 30-day lookback when your sales cycle is 90 days. The result is a report that shows almost no closed-won attribution and makes your campaigns look like they're not working.
Rule: Set your attribution lookback window to your average sales cycle + 30 days.
If your average time from first contact to closed deal is 75 days, run your closed-won attribution report looking back 105 days. Your pipeline report should look back the same window, since deals you just created in the last 30 days haven't had time to close yet.
Calculating your average sales cycle:
SELECT
AVG(DATEDIFF(closed_date, created_date)) as avg_days_to_close
FROM deals
WHERE stage = 'Closed Won'
AND created_at >= DATE_SUB(CURRENT_DATE, INTERVAL 365 DAY)
Run this query in your CRM or BI tool. The result is your actual sales cycle length. Use it to set your attribution lookback window.
Phase 3: Acting on Attribution Data
Attribution data is only useful if it changes your decisions.
3.1 The Weekly Budget Allocation Review
Run the pipeline-by-campaign report weekly. Ask three questions:
1. Which campaigns are generating pipeline at an acceptable cost?
Calculate the breakeven pipeline ROI based on your target payback period. If you need campaigns to generate $5 in pipeline for every $1 of spend (5:1 pipeline ROI), flag any campaigns below that threshold.
2. Which campaigns have degraded week-over-week?
A campaign that was generating 6 opportunities/week last month and is now generating 2/week has changed. The question is why: creative fatigue, audience saturation, increased competition, or a tracking break. Flag it for investigation.
3. Which campaigns are consistently outperforming?
Campaigns generating pipeline ROI above your target should get increased budget allocation — up to the point where their efficiency starts to decay (you'll see this as pipeline ROI declining as you scale spend).
3.2 The Quarterly Attribution Deep Dive
Once per quarter, run the closed-won attribution report (not just pipeline) and look at:
- Which campaigns generated the most revenue, not just the most pipeline?
- Is there a systematic difference in win rate across campaign sources? (deals from campaign X close at 35%, deals from campaign Y close at 12% — that's important signal about lead quality, not just volume)
- Which campaigns have pipeline but no closed-won yet? (This is either a sales problem or you need a longer lookback window)
3.3 Communicating Attribution to Leadership
The board and CFO want to know: "Is our marketing spend generating revenue?"
The answer requires:
- Spend this quarter by channel (pull from your ad platforms)
- Pipeline attributed to marketing this quarter (from your CRM report)
- Revenue attributed to marketing this quarter (closed-won deals with marketing-sourced UTMs)
- Pipeline-to-revenue conversion rate by channel (do LinkedIn leads close as well as Google leads?)
Present these numbers together. Don't present spend without pipeline attribution, and don't present pipeline without the revenue close rate. All three together tell the complete story.
Common Attribution Mistakes to Avoid
Mistake 1: Using ad platform attribution as your revenue number.
LinkedIn will tell you it generated 45 conversions last month. Your CRM shows 20 deals with LinkedIn UTMs. Don't add those numbers; don't average them. Use your CRM number for budget decisions. Use the platform number as a directional signal only.
Mistake 2: Running a short lookback window on a long sales cycle.
90-day lookback on a 120-day average sales cycle will show almost no closed-won attribution. You'll conclude your campaigns don't work. Extend the window.
Mistake 3: Not accounting for pipeline that hasn't closed yet.
A campaign that ran 2 months ago may have generated significant pipeline that hasn't closed yet. Pipeline ROI (which includes open deals) is a better metric than revenue ROI (which only counts closed deals) for evaluating recent campaigns. Use both: revenue ROI for campaigns that have fully cycled through, pipeline ROI for more recent campaigns.
Mistake 4: Ignoring influence attribution.
Some deals were sourced by one channel but influenced by others. A prospect may have first engaged through a Google search, then been nurtured by LinkedIn content, then triggered by an email campaign. First-touch attribution credits Google. Multi-touch attribution shows the full picture. Run both; make budget decisions based on multi-touch.
Mistake 5: Treating offline conversions as unattributable.
Sales calls that happen over phone or in person, referrals that come via introduction, deals that start with an event conversation — these are often written off as "unattributable." Many of them are attributable: the prospect may have first engaged digitally, and your UTM system may have captured their source before the offline conversion happened. Check your CRM: does the "unattributed" deal contact have UTM data? Often the answer is yes.
The Automated Attribution Stack with Cogny
Maintaining this attribution stack manually — weekly UTM audits, joining spend data with CRM pipeline, running the lookback-window-adjusted closed-won report — is time-intensive. It tends to get done once, then deprioritized when things get busy.
Cogny's Growth Ticket system automates the core loop:
- Continuous UTM monitoring: Alerts you when UTM capture rate drops below your baseline (e.g., the booking tool integration broke and UTMs are leaking)
- Weekly pipeline-by-campaign report: Automatically joins ad spend data from LinkedIn and Google with CRM pipeline data, showing pipeline ROI by campaign
- Anomaly detection: Flags campaigns that changed materially week-over-week, with a hypothesis for why (creative fatigue, audience saturation, tracking break)
- Quarterly revenue attribution rollup: Presents the closed-won attribution report with the correct lookback window for your sales cycle
The output is a Growth Ticket in your Slack or CRM: "LinkedIn q3-cmo-retargeting generated $68k in pipeline last month on $4,200 spend (16x pipeline ROI). Revenue attribution on the 90-day window shows $28k closed-won (6.7x revenue ROI). Both metrics are above target. Recommend increasing budget allocation by 20-30% and refreshing creative (frequency reached 7.2 last week)."
That's the kind of specific, actionable guidance that turns attribution from a reporting exercise into a growth lever.
Try Cogny Cloud to automate your B2B attribution stack. Or book a call with Tom to see how we implement this for B2B companies in under two weeks.
Part of the B2B Attribution Series
- Marketing Attribution for B2B: Which Campaigns Actually Drive Sales Calls — The pillar guide (start here)
- How to Track Which Marketing Channel Books Your Sales Calls — UTM and CRM setup
- Does LinkedIn Ad Warm-Up Increase Call Booking Rates? Data & Framework — LinkedIn warm-up measurement
- B2B Marketing Attribution Models Explained: First-Touch, Multi-Touch, CRM-Linked — Model comparison