Server-side tracking, explained: Stop losing your most important data
When you check your website traffic and see 50 conversions, but your payment processor shows you actually had 75... where did the other 25 go?
The culprit is usually not a bug in your code or your web analytics. It's a fundamental limitation of how tracking works. To fix it, you need to move beyond the browser: You need server-side tracking.
The Blind Spot in your analytics
Most web analytics are client-side, which means they rely on a small piece of JavaScript running in the user's browser. When a user clicks a button or visits a page, the JavaScript gathers data, and sends it off to an analytics server.
Unfortunately, there are several things actively working to prevent that JavaScript from doing its job:
- Ad-Blockers: Many users run extensions that specifically look for scripts from known analytics providers and block them before they ever load.
- Privacy-First Browsers: Browsers like Safari (with Intelligent Tracking Prevention) and Firefox are increasingly aggressive about blocking third-party cookies and scripts that look like they're tracking users.
- The "Mobile App" Problem: If your user is interacting with a mobile app rather than a web browser, there is no "DOM" or "JavaScript context" in the traditional sense. If you want to track a purchase made inside an app, client-side web tracking is useless.
- The "Redirect" Problem: If you use internal redirects for outbound links, the browser often moves to the new page before the analytics script has finished sending its data. The event is lost in the shuffle.
This is why your data may feel "off"L You aren't seeing the whole story, just the story of the users who didn't block you.
Client-side vs. Server-side: What's the difference?
To understand the solution, you have to understand the two different ways data moves.
Client-Side Tracking (The Standard)
- Where it happens: In the user's browser (Chrome, Safari, etc.).
- How it works: JavaScript code executes on the user's device.
- The Pros: It's incredibly easy to set up (just copy/paste a snippet) and it has rich "context" (it knows the user's screen resolution, their browser version, and exactly where their mouse clicked).
- The Cons: It's fragile: easily blocked, interrupted, and and/or bypassed.
Server-Side Tracking (The Safety Net)
- Where it happens: On your web server (your backend).
- How it works: Your server sends data directly to the analytics server via an API or HTTP request. The user's browser is never involved in the transmission.
- The Pros: It's incredibly reliable. Ad-blockers can't stop a request coming from your own server. It can capture events that never even happen in a browser (like a subscription renewal).
- The Cons: It requires a bit more engineering, and it lacks the full HTML/DOM context (mouse movement, screen resolution, etc).
| Feature | Client-Side | Server-Side |
|---|---|---|
| Implementation | Easy (JS Snippet) | Moderate (Backend Code) |
| Reliability | Medium (Blocked by Ad-Block/ITP) | High (Direct Server-to-Server) |
| Data Context | Rich (Clicks, Scrolls, UI) | Discrete (Events, Revenue, IDs) |
| Best For | UI behavior & engagement | Conversions & Revenue |
When should you bother with server-side tracking?
You don't need to move everything to the server. In fact, the best approach is a hybrid one. You use client-side tracking to see how people interact with your site (scrolling, clicking, etc.) and server-side tracking to capture the "money events."
Here are the three scenarios where server-side tracking is pretty much non-negotiable:
1. The "Revenue Gap" (E-commerce & Subscriptions)
If you run a subscription service or an e-commerce store, your most important data is your revenue. If a user clicks "Buy," but an ad-blocker prevents the "Purchase Complete" event from firing, your payment provider will show a sale that your analytics says didn't happen.
By triggering the event from your backend after the payment is confirmed in your database, you ensure 100% accuracy. Instead of relying on the user's browser, you are using your own records.
2. The "Mobile App Gap"
If you have a mobile app, you can't just drop a JavaScript snippet into it. While there are mobile SDKs, many of the most critical business events (like a user upgrading their account) happen on your server, not on the device. Server-side tracking allows you to unify your web and app data into one single source of truth.
3. The "Invisible" Conversion (CRM & Webhooks)
Sometimes, a conversion doesn't happen on your website at all. A user might sign up for a trial on Monday, and then they upgrade to a Pro plan via a link in an email on Friday.
Because that upgrade happened via an email link (or a CRM action), there is no "session" on your website to track. Server-side tracking allows you to "reach back in time" and log that goal completion to the original user session.
How Clicky makes server-side tracking simple
Most web analytics platforms make server-side tracking difficult because they want to keep you locked into their browser-based ecosystem. They often don't document their incoming APIs or they rely heavily on "referrers" to verify that data is legitimate.
Clicky is different. We know that your most important data often lives in your backend, not in a browser, and this is why we offer server-side tracking. This allows you to "talk" directly to our tracking servers from your own scripts (PHP, Python, etc.) without jumping through hoops. You just need to send the right parameters to our tracking endpoint.
Code examples
If you are using PHP, you can use file() or cURL to send a remote request. file() is much simpler and doesn't require any set up, so that's what we'll use in our examples below.
You'll need your site_id and sitekey_admin, which you can find in your site preferences.
# Prepare your data
$site_id = "YOUR_SITE_ID";
$sitekey_admin = "YOUR_ADMIN_SITE_KEY"; # *Admin* Site Key!
$ip_address = $_SERVER['REMOTE_ADDR'];
$href = urlencode("/checkout/success");
$title = urlencode("Purchase Completed");
$type = urlencode("click"); # You can also use 'pageview', 'download', or 'outbound'
# Construct the URL
$url = "https://in.getclicky.com/in.php?site_id=$site_id&sitekey_admin=$sitekey_admin&ip_address=$ip_address&href=$href&title=$title&type=$type";
# Send the request
file($url);
Tracking Goals and Revenue
The real power comes when you attach revenue to these events. You're essentailly telling Clicky, "This specific event just generated $49.99 in revenue."
You do this by sending a type=goal request. This is incredibly useful for tracking subscription renewals or high-value lead conversions that happen via your CRM.
A few important notes:
- For
$goal_id, you need to use a predefined goal. But alternatively, you can also define goals on the fly by using a string instead, e.g.$goal_id = urlencode("made+a+sale");. $session_idis required if you're logging a goal later, after a session has ended. This is the Clickky session ID for a particular visit. If you are logging this "live" however, then we will find the live session automatically via the IP address.
# Example: Logging a goal with revenue
$site_id = "YOUR_SITE_ID";
$sitekey_admin = "YOUR_ADMIN_SITE_KEY"; # *Admin* Site Key!
$ip_address = $_SERVER['REMOTE_ADDR'];
$session_id = "USER_SESSION_ID"; # Necessary when declaring goals after a session has ended.
$goal_id = "123";
$revenue = "49.95";
$url = "https://in.getclicky.com/in.php?site_id=$site_id&sitekey_admin=$sitekey_admin&session_id=$session_id&type=goal&goal[id]=$goal_id&goal[revenue]=$revenue";
file($url);
By using this method, you are no longer at the mercy of ad-blockers or browser privacy settings.
The Bottom Line: Don't leave your data to chance
The era of "set it and forget it" JavaScript tracking is over. As browsers become more private and users become more protective of their data, the gap between what is actually happening in your business and what your analytics says is only going to grow.
The smartest way to grow is to build a hybrid tracking strategy:
- Use Client-Side Tracking for real-time user behavior (clicks, scrolls, and engagement).
- Use Server-Side Tracking for your "money events" (purchases, signups, and revenue).
When you combine the two, you get the best of both worlds: the rich, behavioral context of the browser and the unbreakable reliability of the server.
Stop guessing and start knowing.
Start your Clicky trial now and ensure your data is as accurate as your business.