Get data into Amplitude

Send event data from your product (web, mobile, or server), a third-party tool like Segment or mParticle, or the HTTP API. Once events flow into a project, charts, cohorts, and experiments populate from that stream. Most teams start with the Browser Unified SDK, then layer in server-side or third-party sources as the data model grows.

Use the Browser Unified SDK for web products. Choose a server-side SDK or the HTTP API when events originate on your backend, and choose Segment or mParticle when an existing CDP already routes your event stream.

Use this guide when you want to select and configure the integration yourself. To have a coding agent inspect your codebase and write the SDK integration, use Agentic Setup instead.

You need an Amplitude project and its API key before you instrument. If you haven't created one yet, go to Create a project first.

This article is a broad overview. For a deeper explanation of setting up a taxonomy, refer to the Data Taxonomy Playbook.

Send data to Amplitude

Getting data into Amplitude from your product happens at the project level. When you created your first Amplitude project, Amplitude generated an API key that routes your product data to the correct Amplitude project. Use this key to initialize the SDK in your product or website. To find the key in an existing project, refer to Manage organizations and projects.

Data from your product

The most popular way to get data into Amplitude from web products or websites is the Browser Unified SDK.

After you have the API key from the previous section, add it to the Amplitude JavaScript snippet. Paste the snippet into all parts of your product that generate the data you want Amplitude to track. The snippet must appear at the top of every page you want to track with Amplitude, and it must include the amplitude.init() statements. Refer to the screenshot for an example snippet.

Depending on your knowledge of JavaScript, you may want to involve someone from your development or engineering team in this phase. Also refer to the available SDK resources.

After you instrument Amplitude successfully, your data becomes visible as soon as your product begins sending events.

Data from a third-party source

You can import data from a wide range of third-party data sources. To learn more, refer to Amplitude's SDK documentation.

Choose an ingestion method

Most teams should use an SDK or a source integration. SDKs handle batching, retries, and session tracking for you, and source integrations import data from systems you already run. Reach for an ingestion API directly when neither fits.

When you do send events over HTTP, choose between the HTTP V2 API and the Batch Event Upload API. Both accept the same event JSON; they differ in how much traffic they absorb and how quickly events appear.

When to use the HTTP V2 API

Use the HTTP V2 API when you want events to appear as close to real time as possible, you send low volumes, or you need to adjust the data dynamically before sending. It posts events directly from your server to the HTTP V2 endpoint.

Amplitude processes events sent through HTTP V2 for the same device_id in the order it receives them. Ordering doesn't matter for most analyses, but it matters for time-sensitive ones such as funnel analysis.

If one user sends data from several devices, Amplitude doesn't guarantee event ordering across those devices.

Amplitude throttles users and devices that exceed 30 events per second, averaged over a rolling 30-second window, and returns a 429. Pause sending for that user or device for 30 seconds before retrying. HTTP V2 is a poor fit if you need to scale past that rate.

When to use the Batch Event Upload API

Use the Batch Event Upload API to backfill history, migrate from another system, or send workloads you don't need in Amplitude immediately. It accepts much larger bursts for a single user or device.

Batch uploads are the common legitimate reason to exceed the HTTP V2 rate. For example, a team that holds events until the end of the day so it can enrich them first might send 10,000 events for one user in a single minute, roughly 166 events per second, which is far past what HTTP V2 accepts. The Batch Event Upload API absorbs that burst because it allows a higher per-user rate and buffers data for longer.

Rates that high rarely come from real human activity. Outside of deliberate batch uploads, a single user or device producing tens of events per second usually signals broken instrumentation or spam.

APIs and resources

You can send data to Amplitude through SDKs, HTTP API v2, Batch API, Amplitude's integration with Segment, or Amplitude's integration with mParticle. The following lists include examples of APIs and resources. Your Success Manager can help answer questions.

APIs

  • Identify API: Use the Identify API to modify a user's properties without sending an event. You can modify Amplitude default user properties and custom user properties you've already defined.
  • Dashboard REST API: Use the Dashboard REST API to get any data that dashboard graphs display. The results come back as JSON.
  • Export API: Export all events data for an app within a specified date range. The results come back as a zipped archive of JSON files with one or more files per hour.
  • Attribution API: Associate users from various attribution campaigns in Amplitude.
  • HTTP API: Use the HTTP API to send data directly from your server to Amplitude's endpoint.
  • Behavioral Cohorts API: Use the Behavioral Cohorts API to get all cohorts for an app.

Resources

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.

On this page