# Overview

nanolytics gives you web analytics, error tracking and session replay from a single script. You can read your data in the dashboard, ask your coding agent about it over MCP, or query it from your own code with the API. All three return the same numbers.

## Get started

The fastest way to install nanolytics is to paste this into your coding agent (Claude Code, Cursor, Codex or VS Code):

```text
Add nanolytics to this project by following https://nanolytics.dev/AGENTS.md
```

Your agent will ask you to approve the connection once in your browser. It then adds the script to your pages, saves your site's key and connects itself over MCP.

Prefer to do it yourself? [Sign up](https://app.nanolytics.dev/api/auth/sign-in?up) and add one script tag to the head of every page. The [installation guide](/docs/install) covers both options, with instructions for each framework.

## How it works

- **Script**: `<script defer src="https://app.nanolytics.dev/s/pk_….js"></script>`. It's 1.5 KB gzipped, and you never need to edit it: page speed, errors and session replay are options you turn on in the dashboard. See [Tracking options](/docs/collect).
- **Custom events**: track signups, purchases and anything else from the browser with `nl.track()`, or from your server with the Events API. See [Custom events](/docs/events).
- **Dashboard**: at `https://app.nanolytics.dev`, with visitors, pages, sources, goals, funnels, paths, errors and replays.
- **MCP server**: `https://app.nanolytics.dev/mcp`, so Claude Code, Cursor and other agents can answer questions about your traffic. See [MCP server](/docs/mcp).
- **Query API**: `https://api.nanolytics.dev/v1/sites/{site}/query`, the same API the dashboard is built on. See [Query API](/docs/api).

Because the dashboard reads the same API you do, a number means the same thing everywhere. [Metrics](/docs/metrics) explains how each one is calculated.

## Docs for agents

Every page here is also available as Markdown: add `.md` to the end of its URL. Coding agents install nanolytics with [AGENTS.md](https://nanolytics.dev/AGENTS.md), and [llms.txt](https://nanolytics.dev/llms.txt) lists the MCP tools, the API and these pages.
