B2B SaaS attribution for small teams
By Devendra Variya, co-founder of Virling. Published 2026-11-21.
B2B SaaS attribution means crediting each paying customer, and the revenue they bring, to the marketing channel behind the visits before they paid. For a small team it does not need a data warehouse or a marketing ops hire. It needs three things joined together: each visit stored with a visitor ID, that ID or the buyer's email carried to the payment, and payments read from your billing provider.
Signups and demo requests are easy to count. The question a founder actually has is harder: which channels bring customers who pay, and keep paying?
Why B2B attribution is hard
A B2B purchase rarely happens in one visit. The path from first click to first payment breaks in a few predictable places.
- Several visits over weeks. A buyer reads a post, comes back from a search a week later, then types your URL on the day they sign up. Each visit can have a different source, and someone has to decide which one gets the credit.
- Long free trials. A trial charges nothing, so there is no payment to carry the visitor ID. The first real payment may arrive days or weeks after signup, with no browser session attached.
- Invoices. A deal that closes with an invoice is paid from a link in the buyer's inbox. Nothing on that invoice says where the buyer came from.
- Sales calls. When a deal moves to calls and email, it leaves your site. Whatever happens on the call is invisible to any analytics tool. Clicks in the emails can still be tagged; see email signature tracking.
The visit and the payment are two separate records. Attribution is the work of joining them.
Virling credits a B2B payment it can tie to a visitor, by the visitor ID in checkout, a trial start or a Stripe payer's email, and the payment's journey marks the visit that got the credit.
What a small team can track today
You do not need every touch of every stakeholder to make good decisions. These are enough to tell which channels are worth your time:
- First and last touch for each paying customer. Which channel introduced them, and which one brought them back to pay. Virling uses one model per site, set in Site settings: last non-direct by default, first touch, or last touch. Switching rebuilds attribution for every past payment, so you can compare channels under each model. First-touch or last-touch attribution for a SaaS explains when each one fits.
- Revenue by channel. Visitors, revenue and revenue per visitor for each channel, with renewals counted toward the channel of the customer's first payment.
- Time to pay. The median time from first visit to first payment per channel, so you do not cut a channel before its customers have had time to pay. See how long a visitor takes to become a customer.
- Retention by channel. Customers grouped by the channel of their first payment, with how many still pay, so you can see which channel brings customers who stay.
Models such as linear or position-based are not available in Virling yet. For a small team, comparing first touch with last non-direct usually answers the same question with less to explain. If you have only a few customers, marketing attribution for startups lists what to set up and skip at 0, 10 and 100.
Setting it up with Virling
1. Add the script
Add one tag before </head> on every page of your marketing site and your app:
<script defer src="https://app.virling.com/v.js" data-site="yourproduct.com"></script>
The virling_vid cookie is set on your registrable domain, so a site on yourproduct.com and an app on app.yourproduct.com share the same visitor ID. Leave cookieless mode off: without the cookie there is no visitor ID for checkout to carry.
2. Connect Stripe or Paddle
Connect your billing provider with a key that can only read. For Stripe that is a restricted key with Read on Charges, Checkout Sessions, Customers, Events, Invoices, Subscriptions and PaymentIntents; secret keys are refused. For Paddle it is an API key with transaction.read and adjustment.read, plus subscription.read for retention. Virling imports the last 90 days, then checks for new payments every minute. It never creates, changes or refunds anything.
3. Pass the visitor ID at checkout
This is the step that links a payment to the visits before it. Stripe Payment Links on buy.stripe.com need nothing: the script adds the visitor ID when the link is clicked on your site. For a Stripe Checkout Session your server creates, set client_reference_id to the virling_vid cookie, or put it in metadata.virling_vid:
await stripe.checkout.sessions.create({
client_reference_id: req.cookies.virling_vid,
// ...
});With Paddle.js, pass it as customData: { virling_vid: window.virling?.vid?.() } when you open checkout. The code for every provider is in link checkout to visits. Payments without a visitor ID still count toward revenue, as Unattributed.
4. Trials and invoices
Stripe and Paddle report a trial start, and Virling keeps it apart from payments: it is never counted as revenue. A later payment of that customer with no visitor ID of its own is credited to the visits before the trial started. Stripe only sees trials that started after it was connected.
For invoiced deals, send the buyer's email in an identify event when they sign up or book a demo on your site. A Stripe payment with no visitor ID whose payer email matches exactly is credited to that visitor and shows Matched by email on the Payments page. Virling keeps only a salted hash of the email, and matching works for Stripe for now. The details, including what still stays unattributed, are in Stripe invoice attribution for sales-led B2B SaaS, and tracking revenue from demo bookings covers the booking form.
Every renewal, upgrade and plan change takes the channel of the customer's first payment, matched by the provider's customer ID. Getting the first payment attributed carries the whole subscription with it. Expansion revenue by acquisition channel shows how to read those upgrades per channel. Renewals of subscriptions whose first payment is older than the 90-day backfill are Unattributed. The full setup for software companies is on the Stripe SaaS integration page and in the SaaS guide.
Reading the numbers
- Pick a range long enough for slow buyers to pay. The Time to pay card tells you how long that is per channel.
- On the Channels card, compare revenue per visitor across channels, not visitors or signups. Use the Source and Campaign tabs to see the posts, sites and UTM campaigns behind a channel.
- Open a payment on the Payments page to see the buyer's journey: every visit before the payment, with the credited one marked.
- Switch the model to first touch, or the lookback window to 365 days, and see which channels move. Channels that rise under first touch are the ones introducing buyers.
- After a month or two, check the Retention page to see whether customers from each channel keep paying. With new MRR, churn and expansion in hand, project MRR and ARR up to 36 months ahead.
If you capture leads before they pay, the lead value calculator turns your lead to paid rate and first-year revenue per customer into what a lead is worth, and the most you can pay for one. If buyers ask questions on your site before they sign up, live chat revenue tracking shows whether those who chat go on to pay.
A worked example: one deal
Example data, made up to show the method: one buyer at an imaginary company, all visits from the same browser, with a $2,400 annual plan paid by invoice.
- Day 0. The buyer finds a blog post through organic search and reads it.
- Day 12. They click a link in your newsletter, read the pricing page and book a demo. The booking form sends an
identifyevent with their work email. - Day 19. The demo call happens. Nothing about it reaches your site.
- Day 26. They type your URL to check the docs: a Direct visit.
- Day 47. They pay the $2,400 Stripe invoice from a link in their inbox. The payment has no visitor ID, but the payer email matches the one from the demo booking, so it is credited to that visitor and shows Matched by email.
All three visits started inside the default 90-day lookback window, so each model can pick from all of them:
| Model | Channel credited | Why |
|---|---|---|
| Last non-direct (default) | The day 26 visit is Direct, so it is skipped and the newsletter visit before it gets the credit. | |
| First touch | Organic search | The day 0 visit is the first one in the window. |
| Last touch | Direct | The day 26 visit is the last one before the payment. |
Under each model the whole $2,400 goes to one channel, and next year's renewal follows the channel of this first payment. The time to pay for this deal is 47 days, from the first visit to the invoice. Add your own closed deals to the sales cycle calculator to see the average and median for yours, then pick a date range at least that long before you judge a channel.
What stays out of reach
- Deals that never touched your site. A buyer met at an event who books by email has no visit to credit. Asking how they heard of you fills part of that gap; see self-reported attribution.
- A different payer. Email matching is exact, so an invoice paid by an accounts team does not match the person who booked the demo.
- Visits outside the lookback window. Only sessions that started inside the window before the payment count: 30, 60, 90 or 365 days, 90 by default.
- Blocked visits. Visitors who block the script are not counted, though their revenue still counts in your total, as Unattributed.
Keep Unattributed as its own line. A growing share usually means a form or checkout stopped sending the visitor ID or email.
Frequently asked questions
What is B2B SaaS attribution?
Crediting each paying customer, and the revenue they bring, to the marketing channel behind the visits before they paid. For a B2B SaaS that means joining a payment that may come weeks later, often through a trial or an invoice, back to the visitor who first read your site.
Why is B2B attribution harder than ecommerce attribution?
Buyers visit several times over weeks, start a free trial that charges nothing, talk to you on calls and often pay an invoice from their inbox. The visit and the payment are separate records, so something has to carry the visitor ID or the buyer's email from your site to the payment.
Should a B2B SaaS use first-touch or last-touch attribution?
Start with last non-direct, the default, then switch to first touch to see which channels introduce buyers. B2B buyers often take weeks to decide, so first touch or a 365-day lookback window can show channels a short last-touch view misses. Changing the model rebuilds attribution for past payments too.
Can an invoice paid after a sales call be attributed?
Yes, if it can be tied to a visitor. A Stripe payment with no visitor ID is credited to a visitor whose email, sent earlier in an identify event, matches the payer email exactly. A deal that never touched your site has no visit to credit.
Do renewals count toward the channel that brought the customer?
Yes. Every renewal takes the channel of the customer's first payment, matched by the provider's customer ID, so a channel keeps the credit for the subscribers it brought.
See which channels bring paying B2B customers
Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.