At its core, Amplitude is a powerful product analytics platform that helps you understand user behavior, optimize features, and drive growth through data‑driven insights. This tutorial will walk you through the foundational steps of setting up and instrumenting event tracking in Amplitude Analytics—from account creation and SDK installation to defining events and validating data in the Dashboard. By the end, you’ll have a working event pipeline, custom dashboards to explore usage patterns, and best practices for maintaining clean, reliable event data as your product evolves.
Why Event Tracking Matters
Event tracking is the foundation of any modern analytics program. By instrumenting key user actions—like “Sign Up”, “Add to Cart”, or “Level Completed”—you unlock the ability to:
Analyze feature adoption and user flows
Measure the impact of product changes
Segment users by behavior
Identify retention drivers and friction points
Amplitude streamlines this process with a purpose‑built data pipeline and rich behavioral analytics tools, so you can focus on interpreting the data rather than wrangling it.
Creating Your Amplitude Project
Sign Up
Go to Amplitude and create a free account.
Select “Create Project” and choose between a “Development” or “Production” workspace.
Grab Your API Key
In the left sidebar, click Settings > Projects.
Copy the “API Key” for your project; you’ll need this when initializing the SDK.
Installing the Amplitude SDK
Amplitude provides first‑class SDKs for web, mobile, and backend environments. Below are quickstart snippets for the most common platforms.
Web (JavaScript) SDK
Then, to log an event:
Mobile (iOS & Android) SDKs
iOS (Swift)
Android (Kotlin)
Defining Your First Events
Before you instrument, sketch out a tracking plan. Decide which user actions map to meaningful metrics and KPIs.
Event Naming Best Practices
Use Camel Case or Title Case: e.g.,
Search Performed
,Profile Updated
.Be Descriptive and Consistent: Keep verbs first (e.g.,
Add to Cart
vs.Cart Added
).Avoid PII: Never include personally identifiable data in event names or properties.
Event Properties and User Properties
Event Properties describe specifics of one action (e.g., product ID, price).
User Properties are global attributes of a user (e.g., subscription tier, signup date).
Sending Events to Amplitude
When you call logEvent
, events are queued locally then sent over HTTPS to Amplitude’s ingestion API. The SDK handles:
Batching: Groups multiple events into a single network request.
Retry Logic: Retries on failed connections.
Session Tracking: Automatically manages session start/end for web and mobile.
You can override defaults:
Validating and Debugging Events
Real‑Time View:
In Amplitude UI, go to Debug under Data to see incoming events in slices of a few seconds.
Event Explorer:
Browse Events under Data to confirm names, properties, and event volume.
Troubleshooting Tips:
Ensure your API key matches your project.
Check browser console or device logs for SDK errors.
Confirm network requests to
api.amplitude.com/2/httpapi
are succeeding.
Building a Basic Dashboard
Once data flows in, you can build dashboards to monitor key metrics.
Create a Chart:
Click Charts > New Chart.
Select Event Segmentation for volume over time.
Configure Your Query:
Choose your event (e.g.,
Button Clicked
).Add filters or segments (e.g., by
button_name
).
Save to Dashboard:
Click Save, then Add to Dashboard.
Create or select an existing dashboard.
You now have a live view of how often your chosen event occurs.