First touch attribution without a customer data platform
Most small operations know their total orders and nothing about what produced them. Fixing that is a cookie and one column, not a platform.
The problem with last click
By the time someone orders, the referrer usually says nothing useful. They arrived from a search, came back directly two days later, and bought. Last touch credits direct, which is true and useless.
What you want is the first thing that ever brought them.
The approach
On the first visit, if no attribution cookie exists, record the source: referrer, any campaign parameters, and the landing page. Store it in a long lived cookie and do not overwrite it on later visits.
At checkout, read the cookie and write those values onto the order record. Now every order carries its origin permanently, independent of whatever analytics you use.
Classify at capture, keep the raw value too
Store both the raw referrer and a simple derived channel: search, social, referral, campaign, direct. Classification lets you group. The raw value lets you fix the classification later when you discover a source you did not anticipate, which you will.
Expect a large unknown bucket
A substantial share of visits arrive with no referrer at all. Privacy settings, apps that strip it, messaging clients, and assistants that summarise rather than link all produce blank referrers. Direct is not a channel, it is the absence of evidence.
Do not let that discourage the exercise. A third of orders with a known first touch is enormously more than none. Just never report the unknown bucket as if it were people typing your domain from memory.
Assistants are a specific blind spot
Traffic arriving from an AI assistant frequently carries no referrer, so it lands in direct. If you judge that channel by referrer data alone you will conclude it sends nothing while it quietly converts. Ask customers directly, even informally, and compare that against what your data claims.
Why put it on the order
Analytics platforms sample, expire and change. The order record does not. Writing attribution onto the order at the moment of purchase means that in two years you can still ask what produced your best customers, using the system you trust most.
Need help with any of this?
These notes are free and always will be. If you would rather someone just set it up, or you are stuck on something similar, get in touch at hello@opsira.io.