Which marketing channel is actually driving revenue? How to connect ad spend to sales with AI

September 27, 2026•7 min read•Vivek Sah

Hi, this is Vivek, building Contextflo. I share practical notes on getting answers from your data, a couple of times a month.

Which marketing channel is actually driving revenue? How to connect ad spend to sales with AI

To find the channel that's driving revenue, start from revenue you recorded yourself, orders in Shopify or closed-won deals in HubSpot or Salesforce, and trace each one back to a channel with UTMs or a lead source field. Divide that revenue by each channel's spend and you have revenue per dollar and cost per sale, numbers no ad dashboard can give you. Look at it twice, once crediting the first touch and once the last, because the channels that start journeys are rarely the ones that finish them. Where the two views disagree about a channel, stop arguing about models and run a holdout test.

Every tool is answering a different question

Ask Google Ads, GA4 and your CRM how many sales Google drove last month and you'll get three numbers. None of them is broken. They just give credit differently.

Who's countingHow it gives creditWhat it's good forWhere it misleads
Each ad platform (Google Ads, Meta, LinkedIn)Credits itself for any conversion inside its attribution window, which can include people who only saw an adComparing campaigns and creatives inside that platformPlatforms can't see each other, so one sale gets claimed two or three times
GA4Its own attribution setting over visits to your siteSeeing the path across channels in one placeMisses visitors who block tracking or decline cookies, and knows nothing about deals closed later in a CRM
Last-click in your own dataThe UTM or referrer on the visit right before the order or form fillA plain floor for each channelUnder-credits channels that start journeys, like paid social and LinkedIn
First-touch in your own dataThe source that brought the person in the first time (HubSpot's original source, Salesforce's lead source)Seeing which channels open doorsUnder-credits search and retargeting, which close them

The platform number is the ceiling, and it overlaps with everyone else's. Your own orders and deals are the ground truth for how much revenue exists. Attribution is only the argument about how to split it. If you sell online, the ads profitability post covers the margin side of that same split.

UTMs are the floor

None of this works if half your traffic arrives as "(not set)" or "direct". Before any analysis, check that:

  1. Every paid link carries utm_source, utm_medium and utm_campaign, spelled the same way every time. "facebook", "Facebook" and "fb" are three channels to any query.
  2. Campaign names in the UTM match the campaign names in the ad platform export, so spend can be joined to revenue on them.
  3. Your checkout or your forms actually keep the UTMs. For B2B, that means hidden form fields that write them onto the contact, and a source field that carries from lead to opportunity to closed-won.
  4. One person owns the naming convention. It drifts the week nobody does.

An hour on this does more for your answer than any attribution tool.

For B2B, follow the lead to the closed deal

Cost per lead is the number ad platforms optimize and the one that misleads most. A channel can deliver cheap leads that never become opportunities. The chain you want is lead source, then opportunity, then closed-won, with spend next to each step:

  • HubSpot: contacts carry an original source, and deals associate to contacts. Export closed-won deals with amount, close date and the associated contact's original source and UTM fields.
  • Salesforce: leads and opportunities both have a Lead Source field. Export an opportunities report with stage, amount, close date and lead source, plus the campaign if you use campaigns.

From there, channel CAC is spend divided by closed-won deals from that channel, and revenue per dollar is closed-won amount divided by spend. Both need a few months of data, since a lead from July may close in October.

When attribution can't be settled, test it

Sooner or later two views disagree about one channel, and no model will break the tie. An incrementality test can, because it measures what happens when the spend goes away.

  1. Pick the channel in question and a metric you trust: store revenue, or pipeline created if deals take months to close.
  2. Turn it off, or cut it hard, for a holdout group. That can be a set of regions (a geo test), or an audience split if the platform supports it.
  3. Leave everything else alone for two to four weeks.
  4. Compare the holdout to the rest. If revenue barely moves, the channel was taking credit for sales that would have happened anyway.

It costs some sales and some patience. It's also the only answer to "does this channel work" that doesn't depend on whose dashboard you believe.

The quick way: exports into Claude

  1. Export spend by campaign and month from each ad platform: Google Ads, Meta, LinkedIn, whatever you run.
  2. Export revenue with a source. Shopify orders with their UTM or referrer columns, or closed-won deals from HubSpot or Salesforce with source and amount. Add opportunities too, if you're B2B.
  3. Optionally, export GA4 sessions and key events by session source and medium, as a cross-check. Connecting Google Analytics to Claude covers a live route instead.
  4. Upload the files to a Claude chat, or put them in a Google Sheet and link it through Claude's Google Drive connector.[1][2]

Then ask in order:

Normalize the source and campaign values in the deals file so the same
channel is spelled one way. Show me the mapping you used before you
change anything.
Join spend by channel to closed-won deals by channel for the last two
quarters. For each channel show spend, leads, opportunities, closed-won
deals, closed-won revenue, cost per closed deal and revenue per dollar.
Redo the closed-won count by first touch (original source) and by last
touch (latest source) side by side. Which channels gain and which lose
credit between the two?

What breaks

Claude caps how many files a chat can hold and how large each one can be, so check Anthropic's current upload limits before assuming size will stop you.[1] Other things will. A CRM export gives you one value per source field, not every touch a buyer had, so "last touch" is only as good as the field your CRM keeps. Claude has to rebuild the channel mapping from scratch every chat, and it may group "paid social" differently next month. And since deals close slowly, you'll want to rerun this monthly, which means exporting all of it again.

Connect it once with Contextflo

Connect the Google Sheet where you track spend to Contextflo once, and Claude or ChatGPT can read it directly alongside the CRM and ad exports you upload, and your warehouse too if you have one.

If I were setting this up, the channel mapping would go in first. Tell the agent which UTM and source values count as "paid social" or "paid search," and every later question uses it instead of a fresh guess.

Share that mapping with the team, and whoever asks next month gets the same channel breakdown, not a different grouping each time someone starts a new chat.

The durable version: a warehouse

Once this is a monthly review, stop exporting. Fivetran has Google Ads, HubSpot and Salesforce connectors,[3][4][5] and Airbyte, which has a free open-source version, has Google Ads, HubSpot and Salesforce sources.[6][7][8] Both also cover Meta ads, and both load into BigQuery, Snowflake or Postgres on a schedule. Nobody has to remember the export, and with deals that take a quarter to close, the monthly rerun is exactly what gets skipped.

Then point Claude at it, directly as in Claude with BigQuery, or through Contextflo so the channel mapping and the CAC definition are shared by everyone who asks.

Worked example: cheap leads, expensive deals

These numbers are made up for illustration. A B2B software company spends $60,000 on ads in a half-year and closes 22 deals, 12 of which trace back to paid channels.

Google AdsLinkedIn AdsMeta
Spend$30,000$20,000$10,000
Leads in the CRM260120340
Cost per lead$115$167$29
Opportunities26186
Closed-won (first touch)651
Closed-won (last touch)831
Closed-won revenue (first touch)$72,000$80,000$9,000
Cost per closed deal (first touch)$5,000$4,000$10,000
Revenue per dollar (first touch)2.44.00.9

Meta wins on cost per lead by a mile and loses on everything after it: 340 leads, six opportunities, one deal. That one is easy. Its leads aren't buyers, and the budget belongs elsewhere or needs a different offer.

LinkedIn is the harder call. By first touch it's the best channel here, at $4 of revenue per dollar. By last touch it drops from five deals to three, and Google picks up two, because buyers who met the company on LinkedIn later searched for it by name. Both stories are plausible. The table can't pick one, and a holdout can: pause LinkedIn in a few regions for a quarter and watch pipeline created there.

The table won't tell you which channel is best. It tells you which question to test next, and that's the part most teams skip.

FAQ

How do I know which marketing channel is driving revenue? Start from revenue you recorded yourself, orders in Shopify or closed-won deals in your CRM, and tag each one with the channel that brought it in using UTMs or the CRM's lead source field. Then divide that revenue by what you spent on each channel. Ad platform dashboards can't answer this on their own, because each one credits itself and none of them sees your closed deals.

Why don't GA4, Google Ads and my CRM show the same conversions? They measure different things with different rules. Ad platforms credit any conversion inside their attribution window, including some from people who only saw an ad. GA4 only sees visits to your site, uses its own attribution setting, and misses visitors who block tracking or decline cookies. Your CRM records a lead source when the contact is created, which may not be the channel that got them to buy. Each number is right by its own definition.

What is the difference between first-touch and last-click attribution? First-touch gives all the credit to the channel that brought someone in the first time. Last-click gives it all to the channel they came from right before converting. First-touch favors discovery channels like paid social and LinkedIn, last-click favors search and retargeting, and neither is the true answer. Looking at both side by side shows which channels start journeys and which ones finish them.

How do I track which ads lead to closed deals in HubSpot or Salesforce? Put consistent UTMs on every ad, make sure your forms pass them into the CRM, and keep a source field on the contact or lead that carries through to the deal or opportunity. Then export closed-won deals with their source and amount, export spend by campaign from each ad platform, and join the two on campaign or channel. That gives you cost per closed deal instead of cost per lead.

Can Claude tell me which marketing channel works best? Claude can do the arithmetic if you give it the right data: spend by channel from each ad platform plus orders or closed-won deals with a source attached. Upload the exports to a chat or link a Google Sheet, and ask for revenue per dollar and cost per closed deal by channel. It can't settle attribution by itself. When first-touch and last-click disagree about a channel, a holdout test is the way to find out.