Server-side tracker

The Rampify JS tracker fires when a browser executes JavaScript — that catches every human visitor. But LLM agents (ChatGPT-User, Claude-User, Perplexity-User), training crawlers (Bytespider, GPTBot, anthropic-ai), and search/bot crawlers (Googlebot, Bingbot) all fetch server-side. They never run JavaScript. The standard tracker can't see them.

Every analytics product on the market has this gap — Plausible, GA4, Umami, PostHog, Fathom are all JS-only. As AI search becomes the dominant content-consumption surface, JS-only analytics are blind to half the traffic story.

The Rampify server-side tracker fills that gap. Drop a single file into your Netlify or Vercel project, set one env var, and every bot/agent request gets classified and recorded — without changing what your site does for human visitors.

Where to install

Open your project's Settings page in the Rampify dashboard (left sidebar → Settings). The "Project API Key" panel generates the key you'll need for the steps below. The same key works for both the server-side tracker and the MCP server.

How it works#

The template installs as an edge function: a small piece of code that runs on every request to your site, before reaching your origin. It does three things:

  1. Skip non-trackable requests (assets, API paths, framework internals, anything but GET).
  2. Check the User-Agent header. If it matches a known bot/agent/crawler pattern, prepare a payload.
  3. Fire-and-forget POST the payload to https://www.rampify.dev/api/collect with your project's API key. Then immediately return control to your site — the request to Rampify never blocks your page render.

If anything fails — missing API key, network error, Rampify is down — the function falls through silently. Your site continues to render exactly as it did before. There is no failure mode where the tracker breaks your site.

Audit the code before you install#

The template is intentionally short (~120 lines, self-contained, no hidden imports). Read it before you deploy:

What this code sends to Rampify#

For every request that matches a known bot/agent/crawler User-Agent:

  • URL the bot requested (path + query string)
  • Referrer header (if present)
  • User-Agent string verbatim
  • Country and region code (pre-resolved by your platform's edge — e.g. US / CA)
  • Accept-Language value (first locale only)

That's it. The payload is one JSON POST, fire-and-forget, never blocks your origin.

What this code never does#

  • No visitor IPs leave your edge. Country and region are resolved by Netlify or Vercel before the function runs; we only receive the codes.
  • No cookies, no localStorage, no fingerprint hashing. No identifier is set on the visitor.
  • No JavaScript injected into your pages. This runs server-side only.
  • No data on human visitors. The User-Agent regex filters to bots/agents/crawlers — humans pass straight through to your origin and are tracked (if at all) by your existing JS analytics.
  • No requests modified. The function calls next() with the original request unchanged. Your origin sees exactly what it saw before.

You'll want to disclose server-side analytics on bots in your privacy policy regardless — that's standard. But the data Rampify receives contains no PII, so you don't have a new compliance surface.

Install on Netlify#

The template uses Netlify Edge Functions (Deno runtime, free tier 1M invocations/month).

1. Generate an API key#

In the Rampify dashboard, open Settings for your project and click Generate key in the Project API Key panel. Copy the sk_live_… value — you'll only see it once.

2. Set the environment variable#

In Netlify → Site configuration → Environment variables, add:

RAMPIFY_API_KEY=sk_live_…  (paste your key here)

3. Add the edge function#

From your project root:

mkdir -p netlify/edge-functions && \
  curl -o netlify/edge-functions/rampify.ts \
       https://www.rampify.dev/api/templates/netlify-edge-tracker.ts

4. Wire it up in netlify.toml#

[[edge_functions]]
  path = "/*"
  function = "rampify"

5. Deploy#

Push to your repo. Netlify auto-deploys the edge function. Back in Rampify Settings, the Server-side tracker traffic panel will transition from "Waiting for first event…" to "N events in last 24h" once a bot or LLM agent visits your site.

To force an immediate test, hit your site with a bot UA:

curl -A 'Claude-User/1.0' https://your-domain.com/

You should see the event in the Rampify dashboard within seconds.

Install on Vercel#

The template uses Next.js routing-middleware (proxy.ts for Next.js 16+, middleware.ts for ≤15).

1. Generate an API key#

Same as Netlify — open Settings for your project and click Generate key in the Project API Key panel.

2. Set the environment variable#

In Vercel → Project settings → Environment Variables, add:

RAMPIFY_API_KEY=sk_live_…  (paste your key here)

3. Install the Vercel runtime helper#

npm install @vercel/functions

4. Drop the middleware at the project root#

For Next.js 16 or later:

curl -o proxy.ts https://www.rampify.dev/api/templates/vercel-proxy.ts

For Next.js 15 or earlier, save it as middleware.ts instead. (The exported function name middleware is what Next.js looks up; the filename varies by version.)

5. Deploy#

Push to your repo. Vercel auto-deploys the middleware. Back in Rampify Settings, the Server-side tracker traffic panel will transition once the first bot/agent request hits your site.

What the dashboard shows after install#

The Server-side tracker traffic panel on your project's Settings page polls every 10 seconds and updates the status block:

  • "Waiting for first event…" — the function is deployed but no bot has visited yet, or the API key isn't reaching Rampify.
  • "N events in last 24h" — bot/LLM-agent traffic is flowing. Sample user-agents are listed below for sanity-checking.

The full per-event breakdown (which bot, which page, when) lives on the existing Traffic dashboard. Filter by visitor_type to see just LLM agents or just crawlers.

Privacy#

The server-side tracker collects the same data the JS tracker does — URL path, referrer, user-agent, pre-resolved geo (country and subdivision code) — and adds nothing else. Visitor IPs never reach Rampify. Geo is resolved at your platform's edge (Netlify and Vercel both expose it) and only the pre-resolved values are sent.

Because the tracker runs server-side and isn't using cookies, fingerprinting, or third-party identifiers, the no-cookies posture from the JS tracker carries over. Your site's privacy policy should still disclose that you're running server-side analytics on bot/agent traffic — that's your responsibility, not Rampify's.

Troubleshooting#

The status panel still says "Waiting for first event…" after I deploy.

  • Check that RAMPIFY_API_KEY is set on the deployed environment (not just local).
  • Hit your site with a bot UA: curl -A 'Claude-User/1.0' https://your-domain.com/. If that produces an event, the tracker is working — you just hadn't received any real bot traffic yet.
  • View your platform's edge function logs. The template logs [rampify] collect failed: on any non-2xx response from /api/collect.

My site has noticeably higher latency after install.

The template uses fire-and-forget — the POST to Rampify never blocks the response. But every request now passes through the edge function before reaching your origin, which adds ~5–20ms even when the function is a no-op. If that's not acceptable, narrow the matcher in netlify.toml (Netlify) or config.matcher (Vercel) to only the routes you care about.

Can I see what the template does before installing?

Yes. Both templates are served as plain text:

The classifier patterns are inline at the top of each file — no hidden imports, nothing magic. Audit before you deploy.