Docs/Edge Telemetry Ingestion
Developer Reference • Telemetry API

Edge Telemetry Ingestion REST API

Technical specification for our versioned ingestion API. Transmit telemetry directly from server environments, mobile applications, and first-party reverse proxies.

API Ingestion Endpoint
https://api.openanalytics.org.in

All ingestion endpoints are served with global CORS headers (Access-Control-Allow-Origin: *) and execute statelessly with sub-15ms edge processing latency.

POST

/v1/collect

Primary telemetry ingestion endpoint. Receives pageviews, heartbeats, Core Web Vitals RUM metrics, and custom conversion events.

Request Payload (Pageview Example):
{
  "type": "pageview",
  "projectId": "prj_your_project_id",
  "pathname": "/pricing",
  "title": "Pricing & Plans",
  "referrer": "https://twitter.com",
  "screenWidth": 1920,
  "screenHeight": 1080
}
Request Payload (Web Vitals RUM Example):
{
  "type": "vitals",
  "projectId": "prj_your_project_id",
  "pathname": "/",
  "lcp": 1850,
  "inp": 120,
  "cls": 0.02,
  "ttfb": 340
}
Response:
{ "ok": true }
POST

/v1/error

Logs uncaught frontend JavaScript exceptions, runtime crashes, and unhandled promise rejections with stack traces.

{
  "projectId": "prj_your_project_id",
  "message": "TypeError: Cannot read property 'map' of undefined",
  "stack": "TypeError: Cannot read property 'map'... at UserList.tsx:42:15",
  "url": "https://example.com/dashboard",
  "lineNumber": 42,
  "columnNumber": 15
}
Adblocker-Resistant Integration

First-Party Reverse Proxy Recipes

To prevent adblockers from blocking external script domains on technical websites, proxy the tracking script through your own domain.

Cloudflare Worker Proxy (15 Lines)worker.js
export default {
  async fetch(request) {
    const url = new URL(request.url);
    if (url.pathname === "/analytics.js") {
      return fetch("https://api.openanalytics.org.in/open.js");
    }
    if (url.pathname === "/api/collect") {
      return fetch("https://api.openanalytics.org.in/v1/collect", {
        method: "POST",
        headers: request.headers,
        body: request.body,
      });
    }
    return new Response("Not found", { status: 404 });
  },
};
Next.js Edge Rewritesnext.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  async rewrites() {
    return [
      {
        source: "/open.js",
        destination: "https://api.openanalytics.org.in/open.js",
      },
      {
        source: "/api/collect",
        destination: "https://api.openanalytics.org.in/v1/collect",
      },
    ];
  },
};
export default nextConfig;