Getting started overview
Integrating with Amplitude involves a series of steps designed to configure your account, obtain necessary credentials, and initiate data flow. The primary method for data ingestion into Amplitude is through event tracking, which can be accomplished using various Software Development Kits (SDKs) or direct HTTP API calls. Amplitude's SDKs and APIs overview covers the available methods.
This guide focuses on the foundational steps required to send your first event data to Amplitude. It covers account creation, locating authentication keys, and a practical example of making an initial API request to confirm successful integration. The process generally follows these stages:
- Account Setup: Register for an Amplitude account, typically starting with the Starter Plan.
- Project Configuration: Create a new project within your Amplitude organization to house your event data.
- Credential Retrieval: Locate your unique Project API Key and Secret Key, which are essential for authenticating API requests.
- First Event Transmission: Send a basic event using either an SDK or a direct HTTP API call to verify data ingestion.
- Data Verification: Confirm the event appears in your Amplitude dashboard.
Below is a quick reference table summarizing these initial steps:
| Step | What to Do | Where |
|---|---|---|
| 1. Sign Up | Create a new Amplitude account. | Amplitude homepage |
| 2. Create Project | Set up a new project in your Amplitude organization. | Amplitude Dashboard > Settings > Projects |
| 3. Get API Keys | Retrieve your Project API Key and Secret Key. | Amplitude Dashboard > Settings > Projects > Your Project > API Keys |
| 4. Send Event | Make your first event tracking call via SDK or API. | Your application code or a cURL command |
| 5. Verify Data | Check the incoming event data in your dashboard. | Amplitude Dashboard > Data > Event Streams |
Create an account and get keys
To begin using Amplitude, you need an account and a project. Amplitude offers a Starter Plan which allows up to 10 million events per month at no cost, which is suitable for initial setup and testing.
Account Registration
- Navigate to the Amplitude website.
- Click on the "Get Started Free" or "Sign Up" button.
- Follow the prompts to create your account. This typically involves providing an email address, setting a password, and confirming your email.
Project Setup
After creating your account, you will be guided to set up your first project. A project in Amplitude is a container for your event data, specific to an application, website, or product. If you are not automatically prompted to create a project, or if you need to create additional projects:
- Log in to your Amplitude account.
- In the left-hand navigation, go to "Settings" and then "Projects".
- Click "+ Add New Project".
- Provide a descriptive name for your project (e.g., "My Web App" or "iOS App").
- Select your desired data residency and industry.
- Click "Create Project".
Obtaining API Keys
Authentication for Amplitude's APIs relies on a Project API Key and, for certain operations, a Secret Key. These keys are unique to each project and are essential for sending data and accessing project-specific information. You can find these keys within your Amplitude project settings:
- From your Amplitude dashboard, select the project you just created or intend to use.
- Navigate to "Settings" > "Projects".
- Under the list of your projects, click on the specific project name.
- On the project settings page, you will see the "API Keys" section, which displays your "Project API Key" and "Secret Key".
- Copy these keys. The Project API Key is used to identify your project when sending events, while the Secret Key is used for more sensitive API operations, such as server-side data exports or specific integrations. Amplitude's HTTP V2 API authentication documentation provides context on their usage.
Your first request
To confirm your setup is correct, send a simple event to Amplitude. This can be done using one of Amplitude's SDKs or directly via the HTTP V2 API. For a quick verification, the HTTP V2 API is often the fastest method as it doesn't require integrating an SDK into a full application environment immediately. The Amplitude HTTP V2 API documentation details the event upload process.
The HTTP V2 API accepts events as a JSON payload in a POST request. Events are sent to the https://api.amplitude.com/2/httpapi endpoint (or https://api.eu.amplitude.com/2/httpapi for EU data residency).
Example: Sending a "Test Event" via cURL
Replace YOUR_API_KEY with your actual Project API Key obtained in the previous step.
curl --location 'https://api.amplitude.com/2/httpapi' \
--header 'Content-Type: application/json' \
--data-raw '{
"api_key": "YOUR_API_KEY",
"events": [
{
"user_id": "test_user_123",
"event_type": "Test Event",
"event_properties": {
"source": "getting_started_guide"
},
"time": 1678886400000
}
]
}'
In this example:
user_id: A unique identifier for the user performing the event. If auser_idis not available, you can use adevice_idinstead.event_type: The name of the event you are tracking (e.g., "Sign Up", "Product Viewed").event_properties: Optional key-value pairs that provide additional context about the event.time: The timestamp of the event in Unix epoch milliseconds. For accurate analytics, ensure this is set correctly. The example uses1678886400000, which corresponds to March 15, 2023, 00:00:00 UTC.
After executing this cURL command, you should receive a successful response from Amplitude. Then, navigate to your Amplitude dashboard, go to "Data" > "Event Streams", and look for "Test Event" to confirm that the event has been received. It might take a few minutes for the event to appear.
Common next steps
Once you've successfully sent your first event to Amplitude, several common next steps will help you further integrate and utilize the platform:
- Integrate an SDK: For most applications, using an Amplitude SDK is the recommended approach for event tracking as it handles many complexities like session management, device identification, and offline tracking. Amplitude provides SDKs for a wide range of platforms and languages, including JavaScript, Python, Java, Swift, Kotlin, and more.
- Define Your Event Taxonomy: Plan out the specific events and user properties you want to track. A well-defined event taxonomy is crucial for meaningful analytics. This involves deciding what actions users take, what characteristics users have, and what properties describe those actions.
-
Implement User Identification: Beyond anonymous tracking, it's important to identify your users consistently across devices and sessions. Implement
setUserId()or similar methods in your chosen SDK to link events to specific user profiles. Amplitude's tracking unique users documentation provides guidance. -
Track User Properties: Send user properties (e.g., subscription status, plan type, registration date) to Amplitude to segment your users and analyze behavior by different user groups. This is typically done using
setUserProperties()methods in the SDKs. - Explore the Amplitude Dashboard: Familiarize yourself with the various charts and reports available in Amplitude Analytics. Start by building simple charts like "Event Segmentation" to analyze the frequency of your tracked events or "Funnel Analysis" to understand user conversion paths. The Amplitude charts and reports guide covers this.
- Set Up Data Destinations: If you need to export your Amplitude data to other tools (e.g., data warehouses, marketing automation platforms), configure data destinations within Amplitude.
- Review Data Governance: As you scale, regularly review your data governance practices within Amplitude. This includes managing data validity, blocking unwanted events, and ensuring data quality.
Troubleshooting the first call
Encountering issues during your first Amplitude API call or SDK integration is common. Here are some troubleshooting steps:
- Verify API Key: Double-check that the Project API Key used in your request exactly matches the key displayed in your Amplitude project settings. A common mistake is a typo or using the wrong project's key.
-
Check Endpoint: Ensure you are sending events to the correct Amplitude HTTP V2 API endpoint (
https://api.amplitude.com/2/httpapiorhttps://api.eu.amplitude.com/2/httpapifor EU data residency). Using an incorrect URL will result in connection errors. - Review JSON Payload: For HTTP API calls, inspect your JSON payload for syntax errors (e.g., missing commas, unclosed brackets, incorrect key names). Even a small error can prevent successful parsing. Validate your JSON with a linter or online tool if unsure. The JSON specification provides details on valid JSON structure.
-
Timestamp Format: Ensure the
timefield in your event payload is in Unix epoch milliseconds. Incorrect formats can cause events to be rejected or appear out of order in Amplitude. -
Network Issues: Confirm that your network allows outgoing connections to Amplitude's API endpoints. Firewalls or proxy servers might block these requests. You can test basic connectivity using
ping api.amplitude.comortraceroute api.amplitude.com. - Rate Limits: While unlikely for a first call, be aware that Amplitude has rate limits on their APIs. If you are sending many events rapidly in testing, you might hit these limits.
- Amplitude Dashboard "Project Settings" > "Usage": Check the "Usage" tab within your project settings in the Amplitude dashboard. This section often provides insights into received events, including any potential errors or rejected events.
- SDK-Specific Logs: If using an SDK, enable verbose logging to see detailed output about what the SDK is doing, including any errors it encounters when trying to send events.
- Amplitude Help Center: Consult the Amplitude Help Center for specific error codes or common issues related to event ingestion. Their documentation is extensive and often provides solutions to frequently encountered problems.