# How to Add Analytics to Cursor (3 Ways, From Zero to Tracking)

Add product analytics to any Cursor project in minutes. Three methods: AI prompt, Amplitude Wizard CLI, or the Amplitude MCP plugin.

Source: https://amplitude.com/en-us/explore/data/add-analytics-to-cursor

---

###### Add Amplitude analytics to your Cursor IDE project in minutes

# How to Add Analytics to Cursor (3 Ways, From Zero to Tracking)

Add product analytics to any Cursor project in minutes. Three methods: AI prompt, Amplitude Wizard CLI, or the Amplitude MCP plugin.

<!--$-->

Table of Contents

-

You shipped an app with Cursor. People are signing up. And you have no idea what they're doing once they land.

That gap between "shipped" and "shipping the right thing" is where analytics belongs. If you're building in Cursor, you can add [Amplitude Analytics](https://amplitude.com/amplitude-analytics) in minutes using three different methods, each matched to how much control you want.

Browse this guide

- [Paste one prompt into Cursor](#paste-one-prompt)
- [Run the Wizard CLI for custom events](#wizard-cli)
- [Install the Amplitude MCP plugin](#mcp-plugin)
- [What you can track once you're set up](#what-you-can-track)
- [Start tracking in your IDE](#start-tracking)
- [Frequently asked questions](#faqs)

<!--/$-->

## Paste one prompt into Cursor

The fastest setup takes roughly 90 seconds. Copy the prompt below, paste it into Cursor's agent chat, and the agent handles the rest: installing the SDK, finding your app's client entry point, and wiring up initialization with Autocapture enabled.

Replace YOUR\_API\_KEY with the key from your [Amplitude project settings](https://amplitude.com/docs/get-started/amplitude-quickstart). The agent reads your codebase, identifies the framework, and places the initialization code where it belongs.

Once it's done, load a page in your browser and open the Amplitude Debugger. You'll see page view, session, and element interaction events streaming in. No custom events yet, just every click, form submission, and page navigation tracked automatically.

This method is ideal when you want visibility into what's happening right now without spending time deciding what to track. You can always add custom events later. But for day zero, Autocapture gives you a baseline to work from.

## Run the Wizard CLI for custom events

Autocapture tells you what users do on the surface. Custom events tell you what matters: whether someone completed checkout, invited a teammate, or hit a paywall. The [Amplitude Wizard CLI](https://amplitude.com/blog/amplitude-wizard-cli) generates those custom events by reading your code.

Run one command in your terminal (or inside Cursor's integrated terminal): npx @amplitude/wizard

The CLI walks you through four steps:

1. **Authenticate.** It connects to your Amplitude account and confirms the target project.
2. **Detect your framework.** Next.js, React, Python, or whatever your app runs on. The CLI identifies the stack and picks the right SDK.
3. **Scan your code and propose events.** The CLI reads your codebase, identifies user-facing flows, and proposes specific events with properties. A checkout flow might get checkout\_started, payment\_submitted, and order\_confirmed.
4. **Confirm and instrument.** You review the proposed events, approve or edit them, and the CLI writes the tracking code into your project.

Along with custom events, the Wizard also installs [Session Replay](https://amplitude.com/session-replay), [Feature Experimentation](https://amplitude.com/amplitude-experiment), and [Guides and Surveys](https://amplitude.com/guides-and-surveys). It optionally configures the [Amplitude MCP server](https://amplitude.com/docs/amplitude-ai/amplitude-mcp) in your IDE and connects Slack or Teams so you can share learnings where your team already works.

The whole process takes about five minutes for a typical Next.js app. The CLI skips the tracking plan spreadsheet entirely because your code already contains the answers.

## Install the Amplitude MCP plugin for ongoing analytics

The first two methods handle setup. The [Amplitude MCP plugin](https://amplitude.com/mcp-server) makes analytics part of your ongoing Cursor workflow, so you never have to leave the IDE to understand your product.

Install it from the Cursor marketplace (one click), or add the MCP server manually in your mcp.json.

Once connected, you can talk to Amplitude directly in Cursor's chat. The plugin ships with 25+ skills that cover the full analytics workflow:

- **Instrument new features.** The add-analytics-instrumentation skill reads a PR, branch, or feature directory, discovers what events should be tracked, and produces a concrete instrumentation plan.
- **Analyze your data.** Ask "What's our activation rate this week?" and the agent queries your Amplitude project and returns charts, numbers, and analysis.
- **Create dashboards and charts.** Describe what you want to see in plain language, and the agent builds it in Amplitude without you opening the app.
- **Run experiments.** Design, launch, and analyze A/B tests from Cursor's chat.

Here's what a real workflow looks like. You merge a new onboarding flow on Monday morning. You type "What events should I track for this onboarding flow?" into Cursor. The agent reads the diff, proposes onboarding\_started, profile\_completed, first\_action\_taken, and onboarding\_completed with properties for each step. You approve, and the tracking code gets added. By Tuesday, you're looking at a funnel chart showing where new users drop off.

The MCP plugin uses progressive discovery: it starts with a small tool set to save tokens and discovers more tools as you ask for them.

## What you can track once you're set up

With any of the three methods above, you start collecting data immediately. Here's what becomes available at each level.

**Autocapture (zero custom code):** Page views, sessions, clicks, form submissions, file downloads, web vitals, and attribution. This covers the "what happened" layer.

**Custom events (from the CLI or manual instrumentation):** Conversion milestones like sign-ups, purchases, upgrades, and feature adoption. This is the "what matters" layer.

**Session Replay (included by default):** Visual recordings of user sessions. When a funnel shows a 40% drop-off at step three, [Session Replay](https://amplitude.com/session-replay) shows you exactly what users encountered.

**AI-powered analysis (via MCP plugin):** Once data is flowing, the Amplitude MCP plugin becomes your in-IDE analyst. The [AI Agents](https://amplitude.com/ai-agents) layer can investigate anomalies, surface opportunities, and generate executive-ready summaries.

Amplitude's [2025 Product Benchmark Report](https://amplitude.com/resources/product-benchmark-report) found that 69% of top performers in week-one activation were also top performers in three-month retention. What you measure in the first week of your product's life compounds.

## Start tracking in your IDE

Analytics shouldn't be the thing you get to after launch. It should ship with the code. If you're building in Cursor, the tools to make that happen are already in your IDE.

[Try Amplitude for free today](https://app.amplitude.com/signup) to add analytics to your Cursor project in minutes.

## Frequently asked questions about adding analytics to Cursor

Yes. The Starter plan includes 10K monthly tracked users and up to 2M events with no credit card required. It includes full platform access: analytics, session replay, experimentation, and guides.

Yes. The Wizard CLI auto-detects your framework and installs the correct SDK. The AI prompt method works with any framework that Cursor's agent can parse. Amplitude supports browser, Node.js, Python, iOS, Android, React Native, Flutter, and more.

Yes. All three methods work on existing codebases, not just new projects. The CLI scans your current code structure, and the prompt method reads your existing entry points.

Autocapture records every click, page view, form submission, and session automatically without any code. Custom events track specific actions you define, like "checkout completed" or "invite sent." Autocapture gives you breadth; custom events give you precision.

Not if you install the MCP plugin. You can query data, create charts, analyze experiments, and instrument new features from Cursor's chat. The full Amplitude web app is available if you want it, but the IDE-native workflow handles most day-to-day analytics tasks.
