# AGENTS.md

You are helping a developer add EventDash (cookieless product analytics) to their project, or query EventDash analytics.

## Product

- Tracker: `https://www.eventda.sh/tracker.js` (~11 KB gzip)
- Tracking keys start with `ed_` and belong in the public snippet.
- MCP keys: `edt_` account token, `edr_` per-app read key. Never put these in the tracker.
- MCP endpoint: https://www.eventda.sh/api/mcp (read-only Streamable HTTP)
- Docs: https://www.eventda.sh/llms.txt · https://www.eventda.sh/llms-full.txt · https://www.eventda.sh/docs/ai.md

## Install (user's repo)

1. Do not invent API keys. Ask the user to create a tracking key in EventDash app settings, or read `NEXT_EVENTDASH_API_KEY` / existing script tags. Do not echo the full secret in chat.
2. Detect the stack:
   - Next.js App Router → `app/layout.tsx` + `.env.local` `NEXT_EVENTDASH_API_KEY` (see https://www.eventda.sh/docs/installation/nextjs.md)
   - Next.js Pages Router → `pages/_app.tsx`
   - React / Vue SPA → script in `public/index.html`
   - Other → HTML script tag in `<head>`
3. Ensure `.env.local` is gitignored. Tracker keys still appear in HTML by design.
4. Page views are automatic. Add `data-ed-goal` on 1–3 primary CTAs. Use `data-ed-scroll` only if they asked for section views.
5. Optional: `data-allow-localhost="true"` for local testing.

## Query analytics

If the user wants numbers, drop-off, or top pages: use MCP, not inventing a REST read API. Account tokens need `appId` (call `eventdash_apps_list` first). Do not invent write actions.

## Do not

- Mix tracking keys and MCP tokens
- Send emails, names, or other PII in goal params
- Use `track()` for conversions (that is a custom event on Standard+). Use `trackGoal` / `data-ed-goal`
