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: an AI prompt, Agentic Setup, 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 in minutes using three different methods, each matched to how much control you want.

              Paste one prompt into Cursor

              This is the fastest of the three methods. 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. The agent reads your codebase, identifies the framework, and places the initialization code where it belongs.

              Copy this prompt

              Install and configure Amplitude for this JavaScript web application.

              Use API key: YOUR_API_KEY

              Requirements:

              - Run the implementation only on the client.

              - Initialize Amplitude once during app load.

              - Install the correct browser package for this project.

              - Enable fetchRemoteConfig: true.

              - Enable autocapture for attribution, page views, sessions, element interactions, form interactions, and file downloads.

              - Enable Session Replay with sampleRate: 1.

              - Preserve the project's existing TypeScript and framework patterns.

              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 Agentic Setup for your first custom event

              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. Agentic Setup has Cursor's agent instrument one of those events by reading your code.

              Start Agentic Setup from your project's Setup page in Amplitude. Copy the generated prompt, paste it into Cursor's agent chat, and the agent works through four steps:

              1. Confirm the target. It identifies your app root, Amplitude project, and data region for you to review.
              2. Fetch the right instructions. It uses the Amplitude CLI to retrieve a maintained setup skill for your stack, whether that's a web app, a backend service, or a native mobile app.
              3. Instrument the event you pick. It lists candidate events from your code, and you choose one meaningful event, like checkout_started. The agent installs and initializes the SDK and writes the tracking call.
              4. Check ingestion. You run the app and trigger the event, and the agent checks that your project is receiving data. It then offers to commit the changes once you've reviewed the diff.

              For supported frameworks, the same run turns on automatic event tracking and Session Replay. Agentic Setup only needs your public project API key, so never paste a Secret Key into the chat.

              Ready to track more than one event? Add custom events with amplitude.track() calls, or let the MCP plugin's add-analytics-instrumentation skill (below) plan them from your code.

              Install the Amplitude MCP plugin for ongoing analytics

              The first two methods handle setup. The Amplitude MCP plugin 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 Agentic Setup, the MCP plugin's instrumentation skills, or manual tracking calls): 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 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 layer can investigate anomalies, surface opportunities, and generate executive-ready summaries.

              Amplitude's 2025 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.

              Next steps

              Try Amplitude for free today to add analytics to your Cursor project in minutes.

              Amplitude is the leading all-in-one analytics platform for building better products. Product and engineering teams use Amplitude to connect product analytics and web analytics with session replay, heatmaps, experimentation, feature flags, and guides and surveys in one unified workflow, with AI agents working across all of it. Learn how Amplitude is building self-improving products with Wave, helping teams turn product data into PRs.

              Frequently asked questions about adding analytics to Cursor

              Yes. The Free plan includes 2 million events per month with no credit card required. It includes full platform access: analytics, session replay, experimentation, and guides.

              Yes. Agentic Setup supports client-side, server-side, and native stacks, and the agent picks the right SDK for yours. The AI prompt method is built for JavaScript web apps. 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. Agentic Setup inspects your existing codebase, 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.