How to Send Events to Stealth Analytics from a Website or Backend

Updated

Stealth Analytics accepts any event that can be sent as a POST request, so you can track from a browser script, a backend worker, a payment funnel, or any other system that speaks HTTP. The frontend path is a one-line script in your HTML head; the backend path is a standard JSON payload fired at the edge endpoint from any language or framework. No SDK is required, and the site claims you can reach a first event in about two minutes.

Frontend: one line in the head

For web traffic, drop the provided script into the <head> of your HTML. The site describes the payload as 0.7 KB, compared with roughly 45.0 KB for Google Analytics 4, 3.0 KB for Simple Analytics, and 1.2 KB for Plausible, and says it loads in milliseconds without blocking rendering.

Steps:

  1. Copy the script tag from the Stealth Analytics dashboard or guides.
  2. Paste it into your HTML <head>.
  3. Load the page and confirm the event appears in the dashboard.

Expected result: page traffic shows up in your dashboard without additional configuration.

Backend: POST a JSON payload

To track server-side processes, custom conversions, or anything outside the browser, send a standard JSON payload directly to the edge endpoint. The site's example uses fetch:

await fetch('https://api.stealth...', {
  method: 'POST',
  body: JSON.stringify({ name: 'sale' })
});

The same pattern works from any language or framework that can make an HTTP POST request — the site's framing is "If it can make a POST request, we can track it."

Steps:

  1. Build a JSON body with at least an event name, e.g. { "name": "sale" }.
  2. POST it to the edge endpoint from your server, worker, or script.
  3. Verify the event lands in the dashboard alongside your web traffic.

Expected result: backend events such as database processes and custom conversions appear in the same dashboard as pageviews.

What you can track

Source Method Example
Website Frontend script in <head> Pageviews
Background worker REST API POST Cron job verification
Payment funnel REST API POST { "name": "sale" }
Other systems REST API POST Robotics or custom projects

Plan limits that affect event volume

Custom events per project and event volume are capped by plan, so check your tier before wiring up many event types.

Plan Price Events Retention Custom events per project
Free $0/mo 5,000 30 days 2
Indie Hackers $14/mo 50,000 Unlimited 10
Pro $39/mo 250,000 Unlimited 50

All tiers include full CSV exports, and pricing is per usage bucket rather than per domain — one site or fifty count toward the same limit.

Common snags

  • Custom event cap. The Free plan allows 2 custom events per project. If your backend sends more distinct event names than your plan supports, some will not be tracked.
  • Retention window. Free retention is 30 days; older events are not available for export on that tier.
  • Endpoint details. The example endpoint is truncated in the source. Use the exact URL from your dashboard or guides rather than the abbreviated form shown here.