How to build end-to-end analytics: tracker, postbacks, unit economics
A tracker, server-side postbacks, and unit economics form the foundation of end-to-end analytics. Setting them up properly can reduce CPA by 20-50%.

What end-to-end analytics is, and why it matters
Every touch a user has with an ad - from the click through to the payment - gets stitched into one tracking system, and without it, you're guessing which channel turns a profit and which one just burns the budget. I have seen dozens of projects where margin went negative for one reason alone: attribution ran on last-click, or nobody tracked it at all.
It rests on three pieces working together: the tracker (Keitaro or Binom, say), the postbacks (server-side conversion notifications), and the unit economics (what a customer costs to acquire against what they're worth over time). Once all three run together, you see the cost of a lead from every source and stop guessing at the answer.
The market numbers run like this: setting up end-to-end analytics for one channel costs $300 to $2000, depending on complexity, takes three days to a month, and pays back with a 20-50% drop in CPA once optimization starts running on real numbers instead of guesswork.
The accesses and identifiers to collect first
End-to-end analytics doesn't assemble itself. Get the basics in place before touching any settings, or the setup drags on for weeks and spits out empty numbers at the end.
A typical EdTech funnel runs: click, then lead (a booked consultation), then payment for the first lesson. For iGaming, it's click, registration, first deposit. Every event needs a clear ID that gets passed through to the tracker.
Before you start, get this ready:
- A domain and hosting for the tracker: your own server (a VPS, $10-50 a month) or a cloud provider (DigitalOcean, Hetzner, $5-20 a month).
- A CRM, or at minimum a spreadsheet with lead IDs and statuses - HubSpot or Google Sheets with API access work fine without a full CRM.
- API keys for the ad accounts - Facebook, Google Ads, TikTok: there's no spend data without them.
- A clear read on the funnel: which conversions actually matter (lead, payment, registration), because tracking 50 events is pointless and 3-5 key ones is plenty.
Pick a tracker and deploy it
The tracker works as the heart of the whole system: it takes in the click, assigns a unique sub ID, and passes the visitor on to the lander or site carrying that ID. Postbacks with conversion data come back later tagged with the same ID.
Of the trackers out there, I've worked with Keitaro - popular, licensed from €49 a month plus the server - and Binom, also paid, self-hosted, running around $149 a month, or roughly $104 a month if billed annually, plus the server on top of that. Keitaro suits a newcomer better, with built-in reports and ready-made integrations close at hand. Binom fits someone who can set up a server themselves and wants maximum control.
Deploying the tracker breaks down into a few clear steps. Start with a VPS (Ubuntu, 2 GB RAM covers 5000 clicks a day), then install LEMP (Linux, Nginx, MySQL, PHP) or the tracker's own install script. From there, download the Keitaro or Binom distribution, upload it to the server, and run the web installer, entering the database details plus an admin login and password. The last step is the domain: a subdomain like track.yourdomain.com points at the server's IP through an A record.
Keep the tracker on a separate domain, or ad networks can flag and ban the account. For a site at youroffer.com, something like track.youroffer.com works, or a fully separate go.anotherdomain.com.
Set up postbacks: server-side conversion delivery
When the target action happens, your CRM or lander sends the tracker an HTTP request - the postback. After a successful payment, say, a server-side script fires off a GET request like https://track.youroffer.com/postback?subid={subid}&status=1, and the tracker receives it and logs the conversion.
In the tracker, you create an offer (a campaign) and get a link carrying a subid parameter, usually filled in automatically: https://offer.com/?subid={subid}. On the lander or in the CRM, that subid gets pulled from the URL - through PHP's $_GET['subid'], say - and saved to the session or the database. Once the user reaches the target action, the postback fires from there: a curl request carrying the subid and a conversion code. The typical problems: the postback doesn't arrive because of a CORS block (fixed by sending it from the server), and the subid gets lost in redirects (fixed by saving it to a cookie or local storage).
In PHP, that postback takes three lines: $subid = $_GET['subid']; $url = "https://track.youroffer.com/postback?subid=$subid&status=1"; file_get_contents($url);. Binom's postback looks different - https://track.youroffer.com/postback?cid={clickid}&payout=10 - where the click ID travels through the {clickid} macro, and payout carries the cost of the lead, the exact number that shows up in the report later.
Connect the ad accounts through API
For the tracker to know what you spent on each source, the ad account stats need to flow into it, usually through an API, with the tracker pulling the numbers on its own schedule.
Keitaro ships with a built-in import module for Facebook Ads, Google Ads, TikTok, and a few other platforms - set it up in the Integrations section, drop in the API key (access token) from the Facebook business manager or a Google service account, and the tracker pulls in spend, impressions, and clicks on its own. Binom's integration is manual: it needs a Python parser you build yourself or ready-made scripts, harder to set up but more flexible. One ad account takes 1-2 hours to configure; with 10 accounts, automating it through scripts up front is the smarter move.
One separate catch is API rate limits. Every ad platform caps how often reports can be pulled, and the caps change, so a large number of campaigns calls for an update interval measured in hours rather than minutes. Check the current limit in each platform's API documentation before setting the schedule.
Build the unit economics: CPL, CPA, LTV
Once the numbers are flowing into the tracker, the unit economics is just arithmetic. Cost per lead, CPL, comes from dividing spend by the number of leads; cost per acquisition, CPA, divides spend by the number of payments. LTV, lifetime value, shows the average amount a customer brings in over the whole time they stay with you.
Say you spent $1000 on Facebook and got 50 leads and 5 sales: CPL comes to $20, CPA to $200. At an average order of $150 and 3 purchases per customer, LTV lands at $450 - the channel pays back with room to spare. Across the market, e-commerce CPA usually runs $10-50, SaaS $50-500, iGaming $50-300.
The tracker works out CPL and CPA on its own, provided the postbacks carry a payout value for the lead. LTV has to be calculated separately, since it needs repeat-purchase data from the CRM. Once a week, export the traffic from the tracker into Excel or a BI tool - Metabase or Looker Studio, formerly Google Data Studio, work well - and chart the trend for each channel.
Where tracking loses conversions
- Use server-side postbacks instead of JavaScript to ensure they fire even if the user closes the tab. A thank-you-page redirect can trigger the postback as a backup.
- Prevent duplicate conversions by turning on deduplication by
subidin the tracker; Keitaro filters out repeats automatically when the same ID fires twice. - Sources get mixed when attribution runs on last-click: a user from Google returns via Facebook and gets credited to Facebook instead. Multi-touch models show the full chain but are rare; first touch usually pinpoints the real source.
- Offline conversions go missing when a customer calls instead of submitting a form. Call tracking with Calltouch or Ringostat passes the call ID to the tracker via API.
- Stick to 3-5 key conversions (lead, payment, registration); tracking every mouse movement is noise. Each extra event raises the odds of bugs and report confusion.
What the numbers look like a month after go-live
Once end-to-end analytics goes live, the picture usually clears up fast. Within the first month, it often turns out that one or two channels drive 80% of conversions while the rest just eat the budget - the moment to cut the losing sources and push bids on the ones that work. Realistic results look like this: CPL drops 20-40% over 3 months from budget reallocation, CPA can fall 30-50% if the old attribution ran on last-click and money went to branded search, and the time spent reading reports shrinks from hours to 15 minutes because the tracker shows everything in one place.
On one of my projects - a SaaS with a free trial - end-to-end analytics showed that Telegram Ads pulled a CPL half of Facebook's. We reallocated the budget and CPL fell from $15 to $7.50, though it took a week: setting up postbacks and testing. End-to-end analytics on its own doesn't fix a weak product or a bad landing page - it only points at where the problem lives. When conversion is low, fix the site first, and optimize the traffic after.
FAQ
Which one should you choose: Keitaro or Binom?
Keitaro is easier to set up, with built-in integrations and support behind it. Binom is paid too - self-hosted, around $104-149 a month - but the server and API setup runs far more manual. Keitaro suits a newcomer better; Binom suits someone after maximum control and speed.
Can you build end-to-end analytics without a tracker?
Technically, yes, through UTM tags and Google Analytics. But GA doesn't handle postbacks and gives no click-level conversion data, so accurate attribution still needs a tracker in the end.
How long does the whole setup take?
Three to four days for one channel with a simple lander, stretching to about four weeks for several channels and a complex CRM.
Can postbacks get set up without a developer?
Better with one, but not essential. Anyone who can write a basic PHP or Python script can handle it alone; otherwise, an hour or two of a developer's time covers it.
I can do this on your product
I consult on acquisition, funnels and retention - including hard verticals.
