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.

              Use Amplitude CLI setup skills for your first custom event

              Autocapture shows supported interactions across your app. Custom events capture the business outcomes you define, such as a completed checkout or an accepted invitation. Ask Cursor's agent to follow the Amplitude CLI setup skills to instrument one of those events in your code.

              Have Cursor's agent follow the CLI installation instructions, then use amp skills get integrating-amplitude --region us for a US project, or --region eu for an EU project. Ask it to work through these 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. Ask the agent to inspect your existing tracking and suggest candidate events. Choose one meaningful event, such as checkout_started. If Amplitude is already installed, reuse the existing SDK instance and initialization; do not install a second package or initialize it again. If it is not installed, have the agent follow the setup skill to install and initialize it once. Then add the tracking call after the action succeeds, using your existing naming conventions.
              4. Check ingestion. Run the app and trigger the selected event. The agent can use amp events check-ingestion-by-api-key with your project API key to check whether the project has received recent data. That check does not prove the selected event arrived, so confirm its name and properties in Amplitude's event feed. Review the diff before committing.

              Follow the setup skill's instructions for your framework and preserve existing consent, masking, sampling, and remote configuration settings. Retrieving public skills and checking ingestion with a project API key do not require a Secret Key. 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 (written by your coding agent, the MCP plugin's instrumentation skills, or manual tracking calls): conversion milestones such as sign-ups, purchases, upgrades, and feature adoption. Verify each event before using it in a chart.

              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. Ask your coding agent to use the Amplitude CLI setup skills for your stack and follow the current SDK documentation. The AI prompt method is specifically for JavaScript web apps. Amplitude has SDKs for browser, Node.js, Python, iOS, Android, React Native, Flutter, and other platforms.

              Yes. These methods work with existing codebases. Ask the agent to inspect your existing analytics entry points, reuse the current SDK initialization and event naming conventions, and avoid adding duplicate tracking.

              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.