Amplitude
Server-side event tracking to Amplitude via the HTTP V2 API for product analytics, user behavior, and conversion analysis.
Prerequisites
Before configuring Amplitude in Datafly Signal, you need an Amplitude account, a project, and your API key. Follow the steps below to set these up.
Step 1: Create an Amplitude Account
- Go to amplitude.com and click Get Started.
- Sign up with your email or SSO provider.
- Create your first organization when prompted. The organization name is typically your company name.
- During onboarding, select your data region (US or EU). This cannot be changed later.
Step 2: Create a Project
- In the Amplitude dashboard, click the Settings gear icon in the bottom-left.
- Go to Organization Settings > Projects.
- Click Create Project.
- Enter a project name (e.g. “My Website - Production”).
- Select your data plan and click Create.
Your data region (US or EU) is set at the organization level when you first sign up. All projects within the organization inherit this region. If you need a different region, you must create a separate organization.
Step 3: Find Your API Key
- Go to Settings > Projects and select your project.
- On the General tab, locate the API Key field.
- Copy the API Key — this is the value you will enter in Datafly Signal.
The API Key is safe to use server-side. It is distinct from the Secret Key — the API Key only allows sending events and cannot be used to read data from your project. You do not need the Secret Key for Datafly Signal.
Step 4: Choose Your Data Region
Amplitude offers two data regions:
- US (default):
https://api2.amplitude.com/2/httpapi - EU:
https://api.eu.amplitude.com/2/httpapi
Your data region is determined when you create your Amplitude organization. To confirm which region you are on, check your Amplitude dashboard URL:
- US:
analytics.amplitude.com - EU:
analytics.eu.amplitude.com
Select the matching region when configuring the integration in Signal.
API Endpoint
POST https://api2.amplitude.com/2/httpapi (US)
POST https://api.eu.amplitude.com/2/httpapi (EU)Events are sent as JSON payloads to the HTTP V2 API. Authentication is handled via the api_key field in the request body.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
api_key | secret | Yes | Your Amplitude project API key. Found in Settings > Projects > select your project. |
api_endpoint | select | Yes | Data region for your Amplitude project. Choose United States (US) or European Union (EU). |
min_id_length | number | No | Minimum allowed length for user_id and device_id fields. Amplitude defaults to 5. Set lower if your identifiers are shorter than 5 characters. |
Management UI Setup
- Go to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Amplitude or filter by Analytics.
- Click Install, select a variant if available, and fill in the required fields:
- Paste your API Key from Step 3.
- Select your Data Region (US or EU).
- Optionally set a Minimum ID Length if your identifiers are shorter than 5 characters.
- Click Install Integration to create the integration with a ready-to-use default blueprint.
Management API Setup
curl -X POST http://localhost:8084/v1/admin/integration-catalog/amplitude/install \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Amplitude",
"variant": "default",
"config": {
"api_key": "your_amplitude_api_key",
"api_endpoint": "https://api2.amplitude.com/2/httpapi"
},
"delivery_mode": "server_side"
}'Variants
Amplitude is available in multiple pre-configured variants to match your industry:
| Variant | Key | Description |
|---|---|---|
| Default | default | Standard Amplitude server-side event delivery with user and event property mapping. |
| Retail & Ecommerce | retail | Ecommerce-optimized configuration with revenue tracking, product properties, and purchase funnel events pre-mapped. |
| Media & Entertainment | media | Media-focused configuration with content engagement events, session replay grouping, and playback tracking properties. |
Each variant provides a tuned default blueprint. You can customise any setting after installation.
Identity
Amplitude uses a two-part identity model based on device_id and user_id.
device_id
The device_id is the primary identifier for anonymous visitors. Datafly Signal maps the Datafly anonymous_id (a first-party identifier generated by Datafly.js and persisted in the visitor’s browser) to Amplitude’s device_id field.
This means every event sent to Amplitude includes a stable device_id from the first page view, even before the user has identified themselves.
user_id
When your application calls _df.identify(userId), the user_id is forwarded to Amplitude. Once both device_id and user_id are present on an event, Amplitude merges the anonymous and known user profiles into a single identity.
How Amplitude Resolves Identity
- Anonymous visitor: Events arrive with
device_idonly. Amplitude creates an anonymous user profile. - User identifies: A call to
_df.identify("user-123")causes subsequent events to include bothdevice_idanduser_id. - Merge: Amplitude automatically merges the anonymous profile (by
device_id) with the known profile (byuser_id), attributing prior anonymous activity to the identified user. - Cross-device: If the same
user_idappears from a differentdevice_id, Amplitude links both devices to the same user.
Amplitude’s device_id and user_id must each be at least 5 characters by default. If your identifiers are shorter, set the min_id_length configuration field to a lower value — otherwise Amplitude will reject the event.
Event Mapping
Datafly Signal maps standard event names to their Amplitude equivalents:
| Datafly Event | Amplitude Event | Notes |
|---|---|---|
page (page view) | Page Viewed | Includes page URL, title, referrer as event properties |
Product Viewed | Product Viewed | Product details as event properties |
Product Added | Product Added | Product details as event properties |
Product Removed | Product Removed | Product details as event properties |
Checkout Started | Checkout Started | Cart value, currency, items |
Order Completed | Order Completed | Triggers revenue tracking (see below) |
Products Searched | Products Searched | Search query as event property |
| Custom events | Passed through | Any _df.track("event_name") is sent with its original name |
User Properties
When your application calls _df.identify() with traits, those traits are forwarded to Amplitude as user properties via the user_properties field in the HTTP V2 API payload.
_df.identify("user-123", {
email: "[email protected]",
plan: "premium",
company: "Acme Inc"
});This sets the following user properties in Amplitude:
{
"user_properties": {
"$set": {
"email": "[email protected]",
"plan": "premium",
"company": "Acme Inc"
}
}
}Amplitude’s $set operator creates the property if it does not exist, or updates it if it does. User properties persist across sessions and are attached to the user’s profile in Amplitude.
Revenue Events
Amplitude has a dedicated revenue tracking system. When Datafly Signal receives an Order Completed event, it maps the transaction data to Amplitude’s revenue fields:
| Datafly Property | Amplitude Field | Description |
|---|---|---|
total or revenue | revenue | Total transaction value |
currency | price context | ISO 4217 currency code |
order_id | revenueType context | Transaction identifier |
products[].product_id | productId | Product identifier |
products[].price | price | Unit price |
products[].quantity | quantity | Number of units |
Datafly.js call:
_df.track("Order Completed", {
order_id: "ORD-5521",
total: 89.99,
currency: "GBP",
products: [
{ product_id: "SKU-100", name: "Running Shoes", price: 59.99, quantity: 1 },
{ product_id: "SKU-205", name: "Sport Socks", price: 15.00, quantity: 2 }
]
});In Amplitude, this appears as a revenue event with the total value attributed to the user, and is visible in the Revenue Analysis chart.
Example: Track Event
Datafly.js call:
_df.track("Feature Activated", {
feature_name: "dark_mode",
source: "settings_page"
});Amplitude HTTP V2 API payload sent by Datafly Signal:
{
"api_key": "your_amplitude_api_key",
"events": [
{
"event_type": "Feature Activated",
"user_id": "user-123",
"device_id": "df_abc123def456",
"time": 1711296000000,
"event_properties": {
"feature_name": "dark_mode",
"source": "settings_page"
},
"user_properties": {},
"platform": "Web",
"ip": "203.0.113.42",
"library": "Datafly Signal"
}
],
"options": {
"min_id_length": 5
}
}Example: Page View
Amplitude HTTP V2 API payload:
{
"api_key": "your_amplitude_api_key",
"events": [
{
"event_type": "Page Viewed",
"user_id": "user-123",
"device_id": "df_abc123def456",
"time": 1711296000000,
"event_properties": {
"page_url": "https://example.com/products/widgets",
"page_title": "Widgets | Example Store",
"page_referrer": "https://www.google.com/"
},
"platform": "Web",
"ip": "203.0.113.42",
"library": "Datafly Signal"
}
]
}Custom Events
Any event not in the mapping table is sent to Amplitude with its original name. All event properties are forwarded as Amplitude event_properties.
_df.track("newsletter_signup", { method: "footer_form" });{
"api_key": "your_amplitude_api_key",
"events": [
{
"event_type": "newsletter_signup",
"device_id": "df_abc123def456",
"time": 1711296000000,
"event_properties": {
"method": "footer_form"
},
"platform": "Web",
"library": "Datafly Signal"
}
]
}Testing
Once your integration is active and events are flowing, verify in Amplitude:
- Go to the Amplitude dashboard and open User Look-Up (under the Search icon or via the left sidebar).
- Search by
device_idoruser_idto find the user profile. - Click on the user to see their Event Stream — events should appear in near real-time (typically within seconds).
- Verify that event properties, user properties, and revenue data are populated correctly.
If you do not see events, ensure that the API key matches the correct project and that the data region (US/EU) is correctly configured. Events sent to the wrong region endpoint will be silently dropped.
Debugging
Amplitude Ingestion Debugger
Amplitude provides a built-in ingestion debugger:
- Go to Settings > Projects > select your project.
- Click the Ingestion Debugger tab.
- This shows a real-time feed of events arriving at Amplitude, including any validation errors.
Common Validation Errors
| Error | Cause | Fix |
|---|---|---|
Invalid API key | The api_key does not match any project | Double-check the API key in project settings |
device_id or user_id too short | Identifier is shorter than min_id_length | Set min_id_length to a lower value in the integration config |
Invalid event_type | Empty or null event_type | Ensure all tracked events have a name |
Event too old | Event timestamp is older than Amplitude’s retention window | Check that event timestamps are correct |
Payload too large | Request body exceeds 1 MB | Reduce the number of events per batch |
HTTP Response Codes
| Code | Meaning |
|---|---|
200 | Success — events accepted |
400 | Bad request — check the response body for validation details |
413 | Payload too large — reduce batch size |
429 | Rate limited — reduce event throughput |
Rate Limits
Amplitude allows up to 1,000 events per second and 500,000 events per day per project for the HTTP V2 API on the free plan. Growth and Enterprise plans have higher limits.
| Plan | Events per Second | Events per Month |
|---|---|---|
| Free / Starter | 1,000 | 10 million |
| Growth | 1,000 | Based on contract |
| Enterprise | Custom | Based on contract |
If you receive 429 responses from Amplitude, Datafly Signal will automatically retry events with exponential backoff. No events are lost during rate limiting.
Delivery
Events are delivered server-side from your Datafly Signal infrastructure directly to the Amplitude HTTP V2 API. No client-side Amplitude scripts are loaded for this integration.
Visit the Amplitude HTTP V2 API documentation for full API reference and advanced configuration options.