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

  1. Go to amplitude.com and click Get Started.
  2. Sign up with your email or SSO provider.
  3. Create your first organization when prompted. The organization name is typically your company name.
  4. During onboarding, select your data region (US or EU). This cannot be changed later.

Step 2: Create a Project

  1. In the Amplitude dashboard, click the Settings gear icon in the bottom-left.
  2. Go to Organization Settings > Projects.
  3. Click Create Project.
  4. Enter a project name (e.g. “My Website - Production”).
  5. 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

  1. Go to Settings > Projects and select your project.
  2. On the General tab, locate the API Key field.
  3. 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

FieldTypeRequiredDescription
api_keysecretYesYour Amplitude project API key. Found in Settings > Projects > select your project.
api_endpointselectYesData region for your Amplitude project. Choose United States (US) or European Union (EU).
min_id_lengthnumberNoMinimum 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

  1. Go to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Amplitude or filter by Analytics.
  4. 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.
  5. 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:

VariantKeyDescription
DefaultdefaultStandard Amplitude server-side event delivery with user and event property mapping.
Retail & EcommerceretailEcommerce-optimized configuration with revenue tracking, product properties, and purchase funnel events pre-mapped.
Media & EntertainmentmediaMedia-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

  1. Anonymous visitor: Events arrive with device_id only. Amplitude creates an anonymous user profile.
  2. User identifies: A call to _df.identify("user-123") causes subsequent events to include both device_id and user_id.
  3. Merge: Amplitude automatically merges the anonymous profile (by device_id) with the known profile (by user_id), attributing prior anonymous activity to the identified user.
  4. Cross-device: If the same user_id appears from a different device_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 EventAmplitude EventNotes
page (page view)Page ViewedIncludes page URL, title, referrer as event properties
Product ViewedProduct ViewedProduct details as event properties
Product AddedProduct AddedProduct details as event properties
Product RemovedProduct RemovedProduct details as event properties
Checkout StartedCheckout StartedCart value, currency, items
Order CompletedOrder CompletedTriggers revenue tracking (see below)
Products SearchedProducts SearchedSearch query as event property
Custom eventsPassed throughAny _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 PropertyAmplitude FieldDescription
total or revenuerevenueTotal transaction value
currencyprice contextISO 4217 currency code
order_idrevenueType contextTransaction identifier
products[].product_idproductIdProduct identifier
products[].pricepriceUnit price
products[].quantityquantityNumber 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:

  1. Go to the Amplitude dashboard and open User Look-Up (under the Search icon or via the left sidebar).
  2. Search by device_id or user_id to find the user profile.
  3. Click on the user to see their Event Stream — events should appear in near real-time (typically within seconds).
  4. 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:

  1. Go to Settings > Projects > select your project.
  2. Click the Ingestion Debugger tab.
  3. This shows a real-time feed of events arriving at Amplitude, including any validation errors.

Common Validation Errors

ErrorCauseFix
Invalid API keyThe api_key does not match any projectDouble-check the API key in project settings
device_id or user_id too shortIdentifier is shorter than min_id_lengthSet min_id_length to a lower value in the integration config
Invalid event_typeEmpty or null event_typeEnsure all tracked events have a name
Event too oldEvent timestamp is older than Amplitude’s retention windowCheck that event timestamps are correct
Payload too largeRequest body exceeds 1 MBReduce the number of events per batch

HTTP Response Codes

CodeMeaning
200Success — events accepted
400Bad request — check the response body for validation details
413Payload too large — reduce batch size
429Rate 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.

PlanEvents per SecondEvents per Month
Free / Starter1,00010 million
Growth1,000Based on contract
EnterpriseCustomBased 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.