Bojan Josifoski < founder />

Sample Attribution: The Missing Link Between Your CRM and Real Revenue

February 18, 2026 • Bojan

The Problem

Companies send product samples to prospects all the time. SampleHQ is the platform I built to manage that entire process – and attribution is its most important feature. Flooring, packaging, labels, textiles – it doesn’t matter the industry. The process is always the same: prospect asks for samples, you ship them, and then… nothing. You hope they turn into a deal.

I’ve worked with these companies long enough to know that nobody – and I mean nobody – actually tracks which samples led to which deals. They know how much they spent on samples last quarter. They have no idea what those samples generated in revenue.

That’s what I set out to fix.

What Attribution Actually Means Here

In the simplest terms: a sales rep sends samples to a prospect, and sometime later, a deal closes in HubSpot or Salesforce. Attribution is the system that connects those two events and says “this sample influenced this deal worth this much money.”

Sounds straightforward. It’s not.

A prospect might receive 3 different sample orders over 2 months before a deal closes. Maybe the first order was the one that got their attention, but the second one sealed it. Or maybe all three mattered equally. Different sales teams think about this differently, and they’re all right in their own context.

So instead of picking one model and forcing it on everyone, I built five.

Five Attribution Rules

Each tenant picks the rule that makes sense for how they sell:

Primary Only – the sales rep marks one sample order as the main influence, and it gets 100% of the deal credit. Simple and human-driven.

Last Touch – whatever was delivered most recently before the deal closed gets all the credit. Recency wins.

Equal Split – every linked sample order gets an equal share. Five orders on a $50K deal? Each one gets $10K.

Seventy-Thirty – the primary gets 70%, the rest split 30%. A middle ground.

Per-SKU – credit is weighted based on which specific products the prospect actually cared about. This one requires more setup but gives the most realistic picture.

Each rule is its own class with a shared interface. If I ever need a sixth rule, I write one file. Nothing else changes.

Connecting Deals to Samples

The whole thing falls apart if you can’t connect deals to the sample orders that influenced them. There are three ways this happens:

The rep does it manually. They open a linking interface, pick a CRM deal, and select which sample orders were involved. Each link gets tagged as primary or secondary. Everything is stored with a full audit trail – who linked it, when, and how.

The system suggests it. When a deal closes and nobody bothered to link any samples, the system looks back 90 days for delivered orders sent to the same account. It picks the one closest to the close date and creates an inferred link. It’s clearly labeled as auto-suggested, and reps can override it. But the default is “something” instead of “nothing,” which makes the data way more complete.

The nightly backfill catches the rest. A background job pulls recently closed deals from the CRM API and processes any that don’t have attribution yet. Webhooks handle most deals in real-time, but this job is the safety net – if a webhook was missed or the CRM was slow, the backfill picks it up within 24 hours.

Snapshots, Not Live Computation

One thing I got right early on: computing attribution once and storing the result instead of recalculating every time someone opens a report.

When a deal gets processed, the system loads all linked sample orders, applies the configured rule, computes a credit fraction for each order (a decimal between 0 and 1), and stores everything in a snapshot table. One row per deal, immutable, idempotent. Processing the same deal twice gives you the same result.

Then it expands to the product level – if an order contained 3 different samples, each sample gets an equal share of that order’s credit fraction. All of this lands in a denormalized reporting table that’s indexed and ready for aggregation.

The alternative was computing this on every page load. With hundreds of deals and thousands of sample orders, that would have been painfully slow. The snapshot approach means “top 10 products by attributed revenue” is one indexed query. No loops, no post meta joins, no waiting.

Webhooks + Backfill = Belt and Suspenders

Real-time data comes from CRM webhooks. When a deal stage changes in HubSpot or Salesforce, we get a webhook, store it in a queue, and process it asynchronously. Each event has a unique key so processing the same webhook twice is harmless. Failed processing gets 3 retries with backoff. After that, it’s dead-lettered.

But webhooks aren’t reliable enough to be the only channel. Networks fail, CRMs lag, configurations break. So the nightly backfill job fetches the last 90 days of closed deals from the CRM API and fills in anything that’s missing.

Between the two, attribution data is usually minutes old and never more than a day stale.

Seven Report Pages

There’s no point collecting all this data if you can’t see it. The attribution system powers seven dedicated pages:

An overview dashboard with summary cards, revenue-over-time charts, top products, and top reps. A samples list showing every product’s total attributed revenue. A sample detail page that drills into one product and shows every deal it touched. A reps list for admins to see who’s generating the most attributed revenue. A rep detail page for drilling into one person’s performance. A deals list with links back to the CRM. And a customers list grouping attribution by account.

All of this is filtered server-side by role. Sales reps see their own data only. Admins see everything. Starter plan users see a blurred preview with an upgrade prompt. The API never returns data you’re not supposed to see – that’s enforced at the query level.

The Part That Makes It Sticky

I’ll be honest about why I invested so much time in attribution.

Without it, SampleHQ is a nice tool for managing sample orders. Useful, but replaceable. With it, SampleHQ becomes the system of record for sample ROI. And that data gets more valuable every month – more deals close, more links get created, more patterns emerge.

A company that’s been tracking attribution for 6 months has data they can’t get anywhere else. “Our walnut samples convert at 14:1 ROI.” “Product B outperforms Product A by 34%.” That’s the kind of thing that gets budget approvals and justifies hiring decisions.

About the Author

About the Author

I’m Bojan Josifoski - Co-Founder and the creator of SampleHQ, a multi-tenant SaaS platform for packaging and label manufacturers.

← Back to Blog