Quickstart for engineers
This quickstart is for engineers implementing Amplitude for the first time. Follow these steps to install the Browser SDK, verify that events flow into your project, and identify your users.
You'll set up
Before you start
An Amplitude account and a project API key. Go to Create a project if you don't have one.
Access to your product's codebase (front-end or back-end, depending on your stack).
A Member, Developer, or Admin role in your Amplitude organization.
If your team is still deciding what to track, go to Instrumentation prework first to align on a tracking plan before you write any code.
Install
Add the Browser SDK
The Browser SDK is the fastest path to getting data into Amplitude. Choose one install method and follow its page, which ends with confirming that events arrive:
- Install with a script snippet: one script tag, no build step.
- Install with npm or yarn: for bundled JavaScript apps.
- Set up with an AI prompt: an AI coding tool makes the changes.
Amplitude also provides a pre-configured snippet and an AI prompt in your project settings when you first create an account.
After initialization, call
amplitude.track('Event Name', { property: 'value' })to send your first custom event.Capture
Enable Autocapture
Autocapture tracks clicks, page views, sessions, form interactions, file downloads, and marketing attribution without any manual event calls. The script snippet and AI prompt install methods turn it on for you. To set it yourself, pass the
autocaptureoptions during initialization:jsamplitude.init("AMPLITUDE_API_KEY", { autocapture: { attribution: true, fileDownloads: true, formInteractions: true, pageViews: true, sessions: true, elementInteractions: true, networkTracking: true, webVitals: true, frustrationInteractions: true, }, });Open the Amplitude Debugger to confirm that page view, session, and interaction events are arriving. You don't need to add additional tracking code for the behaviors Autocapture handles.
Autocapture is best for capturing broad behavioral data. For business-critical actions, such as purchases, upgrades, and key feature usage, add explicit
amplitude.track()calls so those events carry the right properties.Identify
Identify your users
Autocapture records what users do, but not who they are. Set a user ID when someone signs up or logs in so Amplitude connects their activity across sessions and devices. Call
reset()at logout so the next person on that device doesn't inherit the ID.js// On sign-up or login amplitude.setUserId("USER_ID"); // On logout amplitude.reset();Replace
USER_IDwith a stable identifier from your own system, not an email address. Set the user ID before you send events that belong to that user. Go to Identify users for best practices on choosing user IDs.
Next steps
Was this helpful?
For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.