Workflow · Track and forecast · Opening soon
Cost per lead by channel
Export your ad spend by channel, new leads by source, and source to channel map from HubSpot. The workflow matches the source keys, adds the mapped channel, totals spend and leads by month, then calculates cost per lead for each channel.
Someone typed
“calculate cost per lead by channel each month from ad spend and new leads by source”
The agent read it as
Calculate cost per lead by channel each month from HubSpot ad spend by channel and HubSpot new leads by source, using HubSpot source to channel map.
What the agent built
7 steps, each one an ordinary Mammoth step you can open and change.
File
HubSpot ad spend by channel
CSV export · 24 rows
File
HubSpot new leads by source
CSV export · 26 rows
File
HubSpot source to channel map
CSV export · 6 rows
Step
Make source key (Source map)
Step 1
Step
Make source key (New leads)
Step 2
Join
Add mapped channels
24 of 26 paired
Step
Total leads by month
Step 4
Step
Total spend by month
Step 5
Join
Match monthly channels
24 of 24 paired
Step
Calculate cost per lead
Step 7
Result
Monthly Channel Lead Cost
25 rows
Schedule
Runs when you say
Proposed
- FileHubSpot ad spend by channelCSV export · 24 rows
- FileHubSpot new leads by sourceCSV export · 26 rows
- FileHubSpot source to channel mapCSV export · 6 rows
- StepTotal spend by monthStep 5
- StepMake source key (New leads)Step 2
- StepMake source key (Source map)Step 1
- JoinAdd mapped channels24 of 26 paired
- StepTotal leads by monthStep 4
- JoinMatch monthly channels24 of 24 paired
- StepCalculate cost per leadStep 7
- ResultMonthly Channel Lead Cost25 rows
- ScheduleRuns when you sayProposed
On the sample files, every step runs and the result has 25 rows.
- Download HubSpot ad spend by channel sample (24 rows)HubSpot: Advertising > Ads > Export
- Download HubSpot new leads by source sample (26 rows)HubSpot: Reports > Analytics Tools > Traffic Analytics / Attribution > Export contacts created by source
- Download HubSpot source to channel map sample (6 rows)HubSpot: Settings > Properties > Source mapping sheet used by the reporting team
What you get back
The result of that run, the rows to look at first.
Monthly Channel Lead CostSample data25 rows
| Channel | Month | Cost per lead | Ad spend | New leads |
|---|---|---|---|---|
| direct | 2026-08-01 | 0 | 0 | 19 |
| display | 2026-08-01 | 68.42 | 2,600 | 38 |
| organic_social | 2026-08-01 | 0 | 0 | 52 |
| paid_search | 2026-08-01 | 50.62 | 8,200 | 162 |
| paid_social | 2026-08-01 | 44.63 | 5,400 | 121 |
| partner | 2026-08-01 | 34.15 | 1,400 | 41 |
| referral | 2026-08-01 | 0 | 0 | 34 |
| display | 2026-09-01 | · | 2,800 | 0 |
| organic_social | 2026-09-01 | 0 | 0 | 58 |
| paid_search | 2026-09-01 | 52.30 | 9,100 | 174 |
| paid_social | 2026-09-01 | 42.96 | 6,100 | 142 |
| partner | 2026-09-01 | 38.46 | 1,500 | 39 |
How it works
How to use the Monthly Channel Lead Cost workflow
- 1Get early accessWe invite people in small batches, job by job. You'll land on this workflow, already built and working on sample files.
- 2Swap in your exportsUpload your own files as they come out of your tools. The agent checks the workflow on your rows.
- 3Change it in words, then turn it onSay what to change and see the new result before anything saves. Then choose when it runs.
Monthly Channel Lead Cost: questions
How do you calculate cost per lead by channel each month?
Export your ad spend by channel, new leads by source, and source to channel map from HubSpot. The workflow matches the source keys, adds the mapped channel, totals spend and leads by month, then calculates cost per lead for each channel. You get monthly channel cost per lead as the result.
What export should you use?
Use exported files for ad spend by channel, new leads by source, and a source to channel map from HubSpot. The workflow reads those spreadsheet-style files and uses them together.
What happens to rows that do not match?
Rows that do not match the mapping or the monthly channel totals do not appear in the final matched result. You can review the unmatched rows in the input files and update the mapping or source values.
How do you change the rules?
Edit the steps in words, for example change the source map, the month grouping, or the channel matching rule. Then run the workflow again on the exported files.
Get early access to this workflow
It opens already built and working on sample files. Swap in your own exports to see your result.
Workflows like this
The number you report every month, rebuilt from the latest export, plus the forecast that follows from it.
- Customer lifetime value by cohortWork out customer lifetime value by signup month cohort from Shopify customers and orders exports, with revenue per customer and average order count.See the workflow Built by the agent
- Profit and loss by monthBuild a monthly profit and loss statement from a QuickBooks general ledger export, with revenue, COGS, gross profit, expenses, and net income.See the workflow Built by the agent
- Pareto (ABC) analysisEvery item ranked by its total, with its share, the running share and an A, B or C classSee the workflow Template
- Inventory turnover by SKURank Shopify SKUs by inventory turnover ratio using product, order, and inventory exports from the last 12 months.See the workflow Built by the agent
- Cohort retentionEach month's new customers, and the share still buying 1, 2, 3… months laterSee the workflow Template
- Customer segmentation by revenueSegment Stripe customers into revenue tiers from exported customer, charge, and threshold files, then count customers and revenue in each tier.See the workflow Built by the agent