Use case · Developers

Analytics for developers: a script tag, an API, a CLI and an MCP server

The best analytics for developers is one you can install in a minute, query from code, script from a terminal and ask from your AI assistant — without an SDK, a tag manager or a dashboard you have to click through. VisitTrack is a 5 KB script plus a REST API, a npx visitrack CLI, server-side events and an MCP server.

Updated

Developers want analytics to behave like any other service: documented endpoints, scoped keys, predictable rate limits, CSV and JSON out, nothing magical in the browser. And increasingly, they want their AI coding assistant to read the numbers and set up tracking for them.

VisitTrack's script needs no build step and handles SPA route changes automatically. Everything in the dashboard is on a versioned REST API, the CLI wraps that API one command per request, POST /api/track takes server-side events, and the MCP server lets Claude, ChatGPT, Cursor and other clients query your analytics — and, with the right scope, create goals and funnels.

What developers actually measure

  1. 1.Docs and README-to-signup conversion

    Which docs pages and quickstarts start journeys that end in an account or an API key — the developer-product equivalent of a landing page.

  2. 2.Real-user Core Web Vitals

    LCP, INP, CLS, FCP and TTFB per page from real browsers, without adding a separate RUM tool.

  3. 3.JavaScript errors in production

    Uncaught errors are recorded automatically as js_error (message, file, line; max five per page) — a lightweight early warning, not a replacement for Sentry.

  4. 4.Server-side conversions

    Events from webhooks and workers (checkout_completed, build_finished) joined to the visitor's browser history through the visitor id.

  5. 5.AI crawlers and AI referrals

    Which AI crawlers read your docs (verified by reverse DNS, never billed) and how many visitors arrive from ChatGPT, Perplexity or Claude.

Questions developers ask (often from the terminal)

How did traffic do this week, and from where?
npx visitrack stats --days 7 and npx visitrack referrers --days 7, or ask the assistant connected over MCP.
Which custom events does the site actually send?
GET /api/v1/events (or the MCP list_events tool) lists event names with counts and example props — check it before building goals.
Can my AI assistant set up a signup funnel?
Yes, with a write:config key or connection: it gets create_goal and create_funnel tools. Creates are idempotent by name, and every change is logged in Settings → Activity.
How do I attribute a server-side signup?
Carry window.visitrack.visitorId() through the flow and POST /api/track with it from your OAuth callback.

How to set up VisitTrack as a developer

  1. Add the script

    In Next.js, use next/script in the root layout (Next.js guide); anywhere else, the plain tag. Add the origin to script-src and connect-src if you send a CSP. data-debug logs every event to the console.

    <script defer data-site="SITE_ID" src="https://visitrack.app/tracker.js"></script>
  2. Type the global once

    Optional chaining keeps calls safe when an ad blocker stops the script.

    declare global {
      interface Window {
        visitrack?: ((name: string, props?: Record<string, unknown>) => void) & {
          identify?: (userId: string, traits?: Record<string, unknown>) => void;
          visitorId?: () => string;
        };
      }
    }
  3. Query from code or the terminal

    Create a key in Settings → API / MCP. Rate limit is 120 requests a minute per key; add format=csv to row resources. Reference: API reference.

    export VISITRACK_API_KEY=...
    npx visitrack stats --days 30
    npx visitrack pages --days 7 --json | jq .
    curl -H "Authorization: Bearer $VISITRACK_API_KEY" "https://visitrack.app/api/v1/referrers?days=30&format=csv"
  4. Connect your AI assistant over MCP

    Clients with MCP sign-in (Claude, ChatGPT connectors, Claude Code, Cursor) only need the URL; others take the same config with an Authorization header. See MCP setup.

    {
      "mcpServers": {
        "visitrack": { "type": "http", "url": "https://visitrack.app/api/mcp" }
      }
    }
  5. Send events from the server

    For webhooks, background jobs and OAuth callbacks. Rate limit: 300 requests per 10 seconds per key. See server-side events.

    curl -X POST https://visitrack.app/api/track \
      -H "Authorization: Bearer $VISITRACK_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"type":"event","visitorId":"VISITOR_ID","name":"build_finished","props":{"ms":8420}}'

Example: a developer tool's docs-led growth, read from the CLI

An open-core API product with docs, a blog and a dashboard; numbers pulled by a weekly script and pasted into the team channel.

Example: a developer tool's docs-led growth, read from the CLI
MetricValueWhat it tells you
Visitors (7 days)6,84062% land on /docs pages
Signups171Quickstart page starts 40% of signup journeys
api_key_created (server event)11869% of signups — the activation event
INP p75 on /docs/search410 msA slow client-side search index — flagged by Web Vitals
js_error events2,310One unhandled promise in the code playground
AI crawler hits18,400 (not billed)GPTBot and ClaudeBot read the API reference daily

Illustrative numbers for a typical site of this kind, not real customer data.

The quickstart is the product's best landing page, the docs search needs a performance fix, and the code playground has a bug no one reported. All three came out of a 20-line script and two npx visitrack commands.

VisitTrack vs PostHog, Umami and Vercel Analytics for developers

Third-party details as of October 2026; check each vendor's docs for current limits.

VisitTrack vs PostHog, Umami and Vercel Analytics for developers
VisitTrackPostHogUmamiVercel Web Analytics
InstallScript tag, no SDKSDK (JS and many languages)Script tagPackage or script on Vercel projects
API / CLI / MCPREST API, CLI, MCP (read + goals/funnels write)Extensive API; MCP server availableAPILimited
Server-side eventsYes, POST /api/trackYes, many SDKsYes, via APICustom events on paid plans
Self-hostingNo — hosted onlyYes (open source)Yes (open source)No
Revenue attributionBuilt in for five billing providersVia events / warehouseRevenue eventsNo

If you need to self-host, Umami or PostHog are the right tools. If you want a hosted, privacy-first tool you can drive from code and from your assistant, VisitTrack fits. See VisitTrack vs PostHog, vs Umami and vs Vercel Analytics.

What VisitTrack costs for a developer project

Server-side events count like browser ones; crawler hits and session replays don't count.

VisitTrack pricing by traffic profile
ProfileEvents / monthPlanPriceNotes
Side project / open-source docs~9,000Up to 10k events/mo$5/mo or $50/yrA few thousand visitors
Developer tool with docs + app~160,000Up to 250k events/mo$29/mo or $290/yr~25k visitors plus server events
API platform~2,400,000Up to 2.5M events/mo$89/mo or $890/yrBig docs portal, many server events

Every feature is on every plan; the price only follows monthly events (pageviews, custom events and payments, counted across all your sites). Bot and AI-crawler hits and session replays are never billed. Yearly billing is ten months' price for twelve, every plan starts with a 14-day free trial with no card, and there's a one-time lifetime deal from $59.

Frequently asked questions

Does VisitTrack have an API?

Yes. Every dashboard resource is on a REST API under /api/v1 (site, stats, timeseries, pages, referrers, countries, devices, revenue, goals, funnels, events, live, visitor, people), with scoped bearer keys, CSV output and a 120-requests-per-minute limit.

Is there a CLI?

Yes. npx visitrack runs a dependency-free CLI with commands matching the REST resources, plus --json and --csv output. Install globally with npm install -g visitrack.

Which AI assistants can use the VisitTrack MCP server?

Any MCP client. Claude, ChatGPT custom connectors, Claude Code, Cursor and the MCP Inspector can connect with sign-in using the URL https://visitrack.app/api/mcp; others use an API key header.

Can I send events from my backend?

Yes. POST /api/track with a secret key accepts event and identify calls, including an optional first-touch object. See server-side events.

Does it work with single-page apps?

Yes. Client-side route changes are detected automatically in React, Next.js, Vue, Svelte and similar frameworks.

Can I self-host VisitTrack?

No. VisitTrack is a hosted service; if self-hosting is a hard requirement, open-source tools such as Umami or Matomo are better fits.

How do I test tracking locally?

The script ignores localhost by default. Add data-allow-local to the tag to test, and data-debug to log every event and skip reason to the console.

Related

See which channels actually bring paying customers

VisitTrack is cookie-free analytics with revenue attribution built in. One script tag, no consent banner, live in two minutes. 14 days free, no card required.