Skip to content
Glossary

Server-side tracking

Server-side tracking means your backend sends events to your analytics tool directly, instead of a script in the visitor's browser. It's the reliable way to record things that happen off the page, such as a confirmed payment, a renewal or a webhook.

Updated

Also called: server-side analytics, server-to-server tracking, backend tracking

Definition

In browser tracking, a script on the page reports what the visitor does. In server-side tracking, your server makes an authenticated HTTP request to the analytics API when something happens in your system. Most setups use both: the browser for page views and clicks, the server for outcomes that matter to the business.

When server-side wins

  • Money. A payment confirmed by your payment provider's webhook is the truth. A browser 'purchase' event can be blocked, sent twice, or faked by anyone calling the script from the console.
  • Events with no page. Renewals, cancellations, background jobs and API usage happen when nobody is on your site.
  • Ad blockers and closed tabs. A request from your server isn't affected by what runs in the visitor's browser.

What it loses

The browser knows the landing page, the referrer, the device and the location. Your server knows none of that unless you saved it. A server event therefore has no traffic source unless you pass one, and it isn't tied to the visitor's browser session.

Server-side tracking in Linqry

Send a POST to /api/track with the site's write key, shown on the site's Install page, as a bearer token. Keep the key on your server; never put it in page code.

curl -X POST https://linqry.com/api/track \
  -H 'authorization: Bearer YOUR_WRITE_KEY' \
  -H 'content-type: application/json' \
  -d '{
    "siteId": "YOUR_SITE_ID",
    "event": "subscription-renewed",
    "url": "https://yourdomain.com/pricing?utm_source=newsletter&utm_medium=email",
    "referrer": "https://news.example.com/",
    "properties": { "plan": "pro" },
    "revenue": 4900
  }'
  • Attribution is what you send. A server event carries exactly the url and referrer in the request; UTM tags in the URL are read as usual. Store the landing URL and referrer at signup and pass them later to credit the original source. Without them the event counts as direct traffic.
  • Hostname check. If you send a url, its hostname must be your site's domain, a subdomain or an allowed host.
  • Real errors. Unlike the browser beacon, the API answers with JSON errors for a bad key, bad input or rate limiting, so you can log and retry.
  • Where it shows. Server events appear in Top custom events, in revenue totals, and in revenue by channel and source. Goals count only visitors who also viewed a page, and a server event's visitor ID doesn't match the browser visitor's, so server events don't add goal conversions or funnel steps.

There is also /api/revenue, a dedicated endpoint for payments that takes an amount in cents, a currency and, optionally, a Linqry visitor ID to attach the payment to that visitor's latest visit. The HTTP API reference and the server-side revenue guide have the details.

Related terms

Frequently asked questions

Do I still need the browser script if I track server-side?

For page views, sources and funnels, yes. Server-side tracking complements the browser script; it doesn't replace it.

Can ad blockers block server-side events?

No. The request goes from your server to Linqry, so nothing in the visitor's browser is involved.

Measure your own site without cookies

No card required · 30-day trial · No cookies