# measuremy.site

> Cookieless website analytics that coding agents can read and act on. One script tag records pageviews, referrers, UTM tags and custom events. An MCP server gives the agent traffic, spike explanations, growth actions and tracked campaign links. 30-day free trial, no card. Plans from $9/month.

## How setup works

Setup connects the coding agent to the measuremy.site MCP server, the person signs in through their browser, and the server hands over the script tag for their site. Nothing secret passes through the chat: the server uses OAuth, so no key is pasted or typed.

### 1. Connect the MCP server

The server is `https://a.measuremy.site/mcp` (streamable HTTP, OAuth sign-in):

- Claude Code: `claude mcp add --scope user --transport http measuremysite https://a.measuremy.site/mcp` (every project gets it; one sign-in covers every site in the account; leave out `--scope user` if the person wants it in this project only), or the plugin, which adds the same server plus an add-analytics skill: `/plugin marketplace add developeron29/measuremysite-plugin`, then `/plugin install measuremysite@measuremysite`
- Cursor: `{"mcpServers": {"measuremysite": {"url": "https://a.measuremy.site/mcp"}}}` in `~/.cursor/mcp.json`
- VS Code (Copilot): `{"servers": {"measuremysite": {"type": "http", "url": "https://a.measuremy.site/mcp"}}}` in `.vscode/mcp.json`
- Codex: `[mcp_servers.measuremysite]` with `url = "https://a.measuremy.site/mcp"` in `~/.codex/config.toml`, then `codex mcp login measuremysite`
- Gemini CLI: `{"mcpServers": {"measuremysite": {"httpUrl": "https://a.measuremy.site/mcp"}}}` in `~/.gemini/settings.json`, then `/mcp auth measuremysite`

### 2. Sign in

A server added during a session loads in the next one. In Claude Code the person restarts with `claude -c` (the conversation continues), then signs in when asked or from `/mcp` → measuremysite → Authenticate. In Cursor, the MCP settings show a Login button; VS Code asks when the server starts; Gemini CLI uses `/mcp auth measuremysite`. The browser opens on measuremy.site: the person signs in or creates an account with a 30-day free trial (accepting the [terms](https://measuremy.site/terms) and [privacy policy](https://measuremy.site/privacy)) and enters the site's production domain, like `example.com`; subdomains are covered. Their email and domain are typed only there.

### 3. Install the script tag

The `get_setup` tool returns the script tag, where it goes, and whether data is arriving. Pass the project's production domain (`domain: "example.com"`, from its config, README or deploy settings; ask the person if unsure): one sign-in covers every site in the account, a new domain is added if the plan has room, and the same connection then works in the person's other projects. Its `data-key` (`pk_...`) is public and safe to commit. The tag goes once in the `<head>` of every page, in the project's shared layout:

- **Next.js:** `npm install next-measuremysite`, then `<Measuremysite siteKey="pk_..." />` (import `{ Measuremysite }` from `next-measuremysite`) once in `app/layout.tsx`'s `<body>` (App Router) or in `pages/_app.tsx` (Pages Router); or `NEXT_PUBLIC_MEASUREMYSITE_KEY` instead of `siteKey`. Events: `track("signup")` from the same package. Without the package: the tag in `app/layout.tsx` inside `<head>` (a plain `<script defer ...>` works), or in `pages/_document.tsx` inside `<Head>`.
- **Vite, React, Vue, Svelte (SPA):** `index.html` `<head>`. Client-side navigation is tracked automatically.
- **SvelteKit:** `src/app.html`. **Nuxt:** `npm install nuxt-measuremysite`, then `modules: ["nuxt-measuremysite"]` and `measuremysite: { key: "pk_..." }` in `nuxt.config.ts` (or `NUXT_PUBLIC_MEASUREMYSITE_KEY`); or `app.head.script` in `nuxt.config`. **Remix / React Router:** `root.tsx`.
- **Astro:** `npx astro add astro-measuremysite`, then `measuremysite({ key: "pk_..." })` in `astro.config.mjs` (or `PUBLIC_MEASUREMYSITE_KEY` in `.env`); or the tag in the base layout's `<head>`. **Hugo / Jekyll / Eleventy:** the base template's `<head>`.
- **Docusaurus:** `npm install docusaurus-plugin-measuremysite`, then `plugins: [["measuremysite", { key: "pk_..." }]]` in `docusaurus.config.js` (or `MEASUREMYSITE_KEY` in the build environment). Events: `track("signup")` from the same package. Without the package: `headTags` in the same config.
- **Rails / Django / Laravel / Express templates:** the main layout template.
- **Plain HTML:** every page's `<head>`.
- **WordPress, Webflow, Shopify, Framer, Squarespace, Wix, Ghost:** edited in the platform's admin, not in code. See https://measuremy.site/docs/install.

If the site sets a Content-Security-Policy, `https://a.measuremy.site` goes in `script-src` and `connect-src`.

### 4. Track the actions that matter

After a signup, purchase or other key action succeeds: `window.measuremysite && measuremysite.track("signup", { plan: "free" })`. Short snake_case names; props must not contain personal data. Or, with no code, `data-measuremysite-event="signup"` on a button or form.

### 5. Optional: /make-public and /make-private

`get_setup` also returns small command files (`slash_commands`): Claude Code `.claude/commands/`, Cursor `.cursor/commands/` (both safe to commit), Codex `~/.codex/prompts/`. With them, the person can type `/make-public` for a shareable dashboard of traffic, spikes and their causes, and `/make-private` to turn it off.

### 6. Deploy and confirm

Data is recorded once the deployed homepage HTML contains the script tag; verification runs on the first visit. If a tag manager injects it, `get_setup` gives a DNS TXT record instead. After deploying, `get_setup` reports `verified` and `events_last_24h`. Spike detection needs a few days of traffic for a baseline.

A note for the project's `CLAUDE.md` or `AGENTS.md`, if the person wants one: "Analytics: measuremy.site (MCP server `measuremysite`). Before marketing work, call get_growth_actions. Use create_tracked_link for every link you publish."

## Without MCP: one command

`npx -y measuremysite@0.1.2 init` (MIT-licensed, no dependencies) does the same setup from a terminal: it prints a sign-in link, waits up to 90 seconds for the browser step (running it again continues the same setup), connects Claude Code, Cursor or Codex (`--agent claude|cursor|codex`) with a key kept in local config, and prints the script tag and the file it belongs in. In Claude Code the person can run it themselves with `! npx measuremysite init`.

Or: sign up at https://measuremy.site/login, add the site in the dashboard, and copy the snippet from its Setup tab.

## Using the MCP tools

Endpoint: `https://a.measuremy.site/mcp` (streamable HTTP; OAuth sign-in, or a site read key as `Authorization: Bearer <read_key>`).

- `get_overview`: visitors, pageviews, change vs the previous period. Start here.
- `find_traffic_spikes`, `explain_spike`: what caused each jump, ranked by source, page and event.
- `get_whats_working`: channels ranked by conversions and growth.
- `get_growth_actions`: a ranked action list built from the site's own numbers.
- `create_tracked_link`: a UTM link for anything you publish. Always use one.
- `get_campaign_results`: what each tracked campaign brought in.
- `create_funnel`, `get_funnel`, `delete_funnel`: where visitors drop off. A funnel is 2-8 ordered steps; a step starting with `/` is a page (`/docs/*` is a prefix), anything else is an event name. To track a click or form submit as an event without code, add `data-measuremysite-event="name"` to the element.
- `add_annotation`: log launches, posts and deploys so spikes have context.
- `set_public_dashboard`: when the user asks to share their analytics, publish a public dashboard (or make it private again) and give them the link. It shows traffic, spikes and their causes; growth actions stay private. Claude Code also lists this as the `make-public` and `make-private` prompts.
- `query_visits`: answer questions about visits: count pageviews or events and visitors that match filters (country, browser, os, source, referrer, page, event), optionally grouped by one of them, by day or by hour. `recent_visits`: the latest individual visits with the same filters. No IP addresses or user agents are stored, so none can be returned.
- `top_countries`, `top_browsers`, `top_systems`: the same breakdowns as the dashboard.
- Also `get_timeseries`, `top_sources`, `top_pages`, `list_events`, and the `plan_marketing` prompt.

## Links

Every page on measuremy.site has a Markdown copy at the same path plus `.md` (the home page is `/index.md`). All the docs, guides and comparisons in one file: [llms-full.txt](https://measuremy.site/llms-full.txt).

- [Install guide for every platform](https://measuremy.site/docs/install.md)
- [Agent setup](https://measuremy.site/docs/mcp.md)
- [How it works](https://measuremy.site/how-it-works.md)
- [Pricing](https://measuremy.site/pricing.md)
- [Self-hosted version: measuremysite-mcp](https://github.com/developeron29/measuremysite-mcp) (MIT, one site, your own Cloudflare account)
