Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Amplitude (Actions) Destination


Destination Info
  • Accepts Page, Alias, Group, Identify and Track calls.
  • Refer to it as Actions Amplitude, or Amplitude (Actions) in the Integrations object
(information)

Additional versions of this destination are available

This page is about the Amplitude (Actions) Destination. See below for information about other versions of the Amplitude destination:

Amplitude(link takes you to an external page) is an event tracking and segmentation platform for your web and mobile apps. By analyzing the actions your users perform, you can gain a better understanding to drive retention, engagement, and conversion.


Benefits of Amplitude (Actions) vs Amplitude Classic

benefits-of-amplitude-actions-vs-amplitude-classic page anchor

Amplitude (Actions) provides the following benefits over the classic Amplitude destination:

  • Fewer settings: Data mapping for actions-based destinations happens in during configuration, which eliminates the need for most settings.
  • Clearer mapping of data: Actions-based destinations enable you to define the mapping between the data Segment receives from your source, and the data Segment sends to the destination.
  • Support for Amplitude's HTTP API v2: Amplitude (Actions) is built on the latest version of Amplitude's HTTP API(link takes you to an external page).
  • Revenue is a top-level property: Amplitude (Actions) elevates revenue to a top-level property in requests sent to Amplitude. This enables inclusion of this data in Amplitude features like customer LTV reports.
  • Tracking in cloud-mode: Amplitude (Actions) supports sending details from cloud-mode sources.

  1. Before you start, go to your Amplitude workspace(link takes you to an external page). Click Settings in the top right and then click Organization Settings to navigate to your Projects in the menu. Select your Project. Copy the Amplitude API Key and Secret Key for the project.
  2. From the Segment web app, click Catalog, then click Destinations.
  3. Find the Destinations Actions item in the left navigation, and click it.
  4. Click the "Amplitude" item to select it and click Configure.
  5. Choose which of your sources to connect the destination to. (You can connect more sources to the destination later.)

Once you have a mapping, you can follow the steps in the Destinations Actions documentation on Customizing mappings.

Log Purchases in existing destination instances

log-purchases-in-existing-destination-instances page anchor

Initially, the Log Event Action was reporting purchases to Amplitude for all events containing a products array, even if the products were just added to cart. This inflated the LTV Chart in Amplitude.

To resolve this, purchase reporting takes place in a new Action called Log Purchase.

For instances created prior to before the Log Purchases action was released, you need to manually add the Log Purchases Action to report purchases to Amplitude.

To manually add the Log Purchases Action:

  1. Add a new Mapping for the Log Purchases Action. The default trigger for this action is Order Completed events.
  2. Modify the Trigger if you need to report purchases for any other events.
  3. Modify the Trigger of Log Event to exclude these same events. This helps you to avoid sending the same event twice.
  4. Enable the Log Purchases mapping.

Connection Modes for Amplitude (Actions) destination

connection-modes-for-amplitude-actions-destination page anchor

The Amplitude (Actions) destination does not offer a device-mode connection mode. Previous deployments of the Amplitude Segment destination required the device-mode connection to use the session_id tracking feature. However, the Amplitude (Actions) destination now includes session ID tracking by default when you use Segment's Analytics.js 2.0 library.

Session tracking is available with Segment's new libraries: Analytics.js 2.0, Swift or Kotlin.

When connected to the Analytics.js 2.0 source, Segment automatically loads a plugin on your website for session tracking and enrichment as an alternative to the Amplitude SDK. This means you don't need to bundle any software or write any code to run on the user's device, and can use more of the Segment platform features for data going to Amplitude, like Protocols filtering and transformations and Unify Identity Resolution.

If you're using one of Segment's Swift, Kotlin, or React Native libraries, you will need to include the Amplitude destination plugin to enable session tracking.

You can read more about Amplitude's tracking sessions(link takes you to an external page) feature in Amplitude's documentation.

The Amplitude destination requires that each event include either a Device ID or a User ID. If a User ID isn't present, Amplitude uses a Device ID, and vice versa, if a Device ID isn't present, Amplitude uses the User ID.

By default, Segment maps the Segment property context.device.id to the Amplitude property Device ID. If context.device.id isn't available, Segment maps the property anonymousId to the Amplitude Device ID. The Actions interface indicates this with the following contents of the Device ID field: coalesce( context.device.id anonymousId ).

Enable session tracking for Analytics.js 2.0

enable-session-tracking-for-analyticsjs-20 page anchor

JavaScript sources automatically enable session tracking.

The session ID Segment passes to Amplitude stores locally in a key-value pair. View the value associated with the analytics_session_idkey to access the session ID. The session ID is set to timeout every 30 minutes by default.

Enable Amplitude session tracking for Swift

enable-amplitude-session-tracking-for-swift page anchor

To enable session tracking in Amplitude when using the Segment Swift library(link takes you to an external page):

  1. Enable trackApplicationLifecycleEvents in your configuration.
  2. Add the Amplitude Session plugin(link takes you to an external page) to your project.
  3. Initialize the plugin (example(link takes you to an external page))
    analytics?.add(plugin: AmplitudeSession(name: "Amplitude"))

Enable Amplitude session tracking for Kotlin

enable-amplitude-session-tracking-for-kotlin page anchor

To enable session tracking in Amplitude when using the Segment Kotlin library(link takes you to an external page):

  1. Enable trackApplicationLifecycleEvents in your configuration.
  2. Add the Amplitude Session plugin(link takes you to an external page) to your project.
  3. Initialize the plugin
    analytics.add(AmplitudeSession())

Enable Amplitude session tracking for iOS

enable-amplitude-session-tracking-for-ios page anchor

To enable session tracking in Amplitude when using the Segment iOS library(link takes you to an external page):

  1. Add the Amplitude Session middleware(link takes you to an external page) to your project.
  2. Add the middleware & enable trackApplicationLifecycleEvents in your configuration:
    1
    NSString *const SEGMENT_WRITE_KEY = @" ... ";
    2
    SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];
    3
    configuration.trackApplicationLifecycleEvents = true
    4
    configuration.sourceMiddleware = @[[[SEGAmplitudeSession alloc] init]];
    5
    [SEGAnalytics setupWithConfiguration:configuration];

Enable Amplitude session tracking for Android

enable-amplitude-session-tracking-for-android page anchor

To enable session tracking in Amplitude when using the Segment Android library(link takes you to an external page):

  1. Add the Amplitude Session middleware(link takes you to an external page) to your project.
    implementation 'com.segment.analytics.android.integrations:amplitude:3.1.0'
  2. Add the middleware & enable trackApplicationLifecycleEvents in your configuration:
    1
    String SEGMENT_WRITE_KEY = " ... ";
    2
    analytics = new Analytics.Builder(this, SEGMENT_WRITE_KEY)
    3
    .trackApplicationLifecycleEvents()
    4
    .useSourceMiddleware(new AmplitudeSessionId())
    5
    .build();

Important differences from the classic Amplitude destination

important-differences-from-the-classic-amplitude-destination page anchor

The classic Amplitude destination captures the following user fields in device-mode (when it runs on the user's device):

  • Device Type (for example, Mac, PC, mobile device)
  • Platform (for example iOS or Android)

Amplitude (Actions) runs in cloud-mode, and does not capture these fields.


Property nameTypeRequiredDescription
API Keystring
required

Amplitude project API key. You can find this key in the "General" tab of your Amplitude project.


Endpoint Regionselect

Optional

The region to send your data.


Secret Keystring
required

Amplitude project secret key. You can find this key in the "General" tab of your Amplitude project.


Amplitude (Actions) has the following presets

Preset NameTriggerDefault Action
Page CallsEvent type = "page"Log Event V2
Browser Session TrackingEvent type = "track", Event type = "identify", Event type = "group", Event type = "page", Event type = "alias"Session Plugin
Screen CallsEvent type = "screen"Log Event V2
Identify CallsEvent type = "identify"Identify User
Track CallsEvent type = "track" and event != "Order Completed"Log Event V2
Order Completed CallsEvent type = "track" and event = "Order Completed"Log Purchase

Build your own Mappings. Combine supported triggers with the following Amplitude-supported actions:

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Merge two users together that would otherwise have different User IDs tracked in Amplitude.

Map User is a Cloud action. The default Trigger is type = "alias"

Property nameTypeRequiredDescription
User IDSTRING

Optional

The User ID to be associated.


Global User IDSTRING

Optional

The Global User ID to associate with the User ID.


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id length (min_id_length) of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.

Set the user ID for a particular device ID or update user properties without sending an event to Amplitude.

Identify User is a Cloud action. The default Trigger is type = "identify"

Property nameTypeRequiredDescription
User IDSTRING

Optional

A UUID (unique user ID) specified by you. Note: If you send a request with a user ID that is not in the Amplitude system yet, then the user tied to that ID will not be marked new until their first event. Required unless device ID is present.


Device IDSTRING

Optional

A device specific identifier, such as the Identifier for Vendor (IDFV) on iOS. Required unless user ID is present.


User PropertiesOBJECT

Optional

Additional data tied to the user in Amplitude. Each distinct value will show up as a user segment on the Amplitude dashboard. Object depth may not exceed 40 layers. Note: You can store property values in an array and date values are transformed into string values.


GroupsOBJECT

Optional

Groups of users for Amplitude's account-level reporting feature. Note: You can only track up to 5 groups. Any groups past that threshold will not be tracked. Note: This feature is only available to Amplitude Enterprise customers who have purchased the Amplitude Accounts add-on.


App VersionSTRING

Optional

Version of the app the user is on.


PlatformSTRING

Optional

The platform of the user's device.


OS NameSTRING

Optional

The mobile operating system or browser of the user's device.


OS VersionSTRING

Optional

The version of the mobile operating system or browser of the user's device.


Device BrandSTRING

Optional

The brand of user's the device.


Device ManufacturerSTRING

Optional

The manufacturer of the user's device.


Device ModelSTRING

Optional

The model of the user's device.


CarrierSTRING

Optional

The user's mobile carrier.


CountrySTRING

Optional

The country in which the user is located.


RegionSTRING

Optional

The geographical region in which the user is located.


CitySTRING

Optional

The city in which the user is located.


Designated Market AreaSTRING

Optional

The Designated Market Area in which the user is located.


LanguageSTRING

Optional

Language the user has set on their device or browser.


Is PayingBOOLEAN

Optional

Whether the user is paying or not.


Initial VersionSTRING

Optional

The version of the app the user was first on.


Insert IDSTRING

Optional

Amplitude will deduplicate subsequent events sent with this ID we have already seen before within the past 7 days. Amplitude recommends generating a UUID or using some combination of device ID, user ID, event type, event ID, and time.


User AgentSTRING

Optional

The user agent of the device sending the event.


User Agent ParsingBOOLEAN

Optional

Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field


Include Raw User AgentBOOLEAN

Optional

Enabling this setting will send user_agent based on the raw user agent string provided in the userAgent field


UTM PropertiesOBJECT

Optional

UTM Tracking Properties


ReferrerSTRING

Optional

The referrer of the web request. Sent to Amplitude as both last touch “referrer” and first touch “initial_referrer”


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id length of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.


LibrarySTRING

Optional

The name of the library that generated the event.


User Agent DataOBJECT

Optional

The user agent data of device sending the event

Send an event to Amplitude.

Log Event is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
User IDSTRING

Optional

A readable ID specified by you. Must have a minimum length of 5 characters. Required unless device ID is present. Note: If you send a request with a user ID that is not in the Amplitude system yet, then the user tied to that ID will not be marked new until their first event.


Device IDSTRING

Optional

A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user ID is present. If a device ID is not sent with the event, it will be set to a hashed version of the user ID.


Event TypeSTRING
required

A unique identifier for your event.


Session IDDATETIME

Optional

The start time of the session, necessary if you want to associate events with a particular system. To use automatic Amplitude session tracking in browsers, enable Analytics 2.0 on your connected source.


TimestampDATETIME

Optional

The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.


Event PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data to be sent along with the event. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


User PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data tied to the user. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


GroupsOBJECT

Optional

Groups of users for the event as an event-level group. You can only track up to 5 groups. Note: This Amplitude feature is only available to Enterprise customers who have purchased the Accounts add-on.


App VersionSTRING

Optional

The current version of your application.


PlatformSTRING

Optional

Platform of the device. If using analytics.js to send events from a Browser and no if no Platform value is provided, the value "Web" will be sent.


OS NameSTRING

Optional

The name of the mobile operating system or browser that the user is using.


OS VersionSTRING

Optional

The version of the mobile operating system or browser the user is using.


Device BrandSTRING

Optional

The device brand that the user is using.


Device ManufacturerSTRING

Optional

The device manufacturer that the user is using.


Device ModelSTRING

Optional

The device model that the user is using.


CarrierSTRING

Optional

The carrier that the user is using.


CountrySTRING

Optional

The current country of the user.


RegionSTRING

Optional

The current region of the user.


CitySTRING

Optional

The current city of the user.


Designated Market AreaSTRING

Optional

The current Designated Market Area of the user.


LanguageSTRING

Optional

The language set by the user.


PriceNUMBER

Optional

The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.


QuantityINTEGER

Optional

The quantity of the item purchased. Defaults to 1 if not specified.


RevenueNUMBER

Optional

Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds. Note: You will need to explicitly set this if you are using the Amplitude in cloud-mode.


Product IDSTRING

Optional

An identifier for the item purchased. You must send a price and quantity or revenue with this field.


Revenue TypeSTRING

Optional

The type of revenue for the item purchased. You must send a price and quantity or revenue with this field.


LatitudeNUMBER

Optional

The current Latitude of the user.


LongtitudeNUMBER

Optional

The current Longitude of the user.


IP AddressSTRING

Optional

The IP address of the user. Use "$remote" to use the IP address on the upload request. Amplitude will use the IP address to reverse lookup a user's location (city, country, region, and DMA). Amplitude has the ability to drop the location and IP address from events once it reaches our servers. You can submit a request to Amplitude's platform specialist team here to configure this for you.


Identifier For Advertiser (IDFA)STRING

Optional

Identifier for Advertiser. (iOS)


Identifier For Vendor (IDFV)STRING

Optional

Identifier for Vendor. (iOS)


Google Play Services Advertising IDSTRING

Optional

Google Play Services advertising ID. (Android)


Android IDSTRING

Optional

Android ID (not the advertising ID). (Android)


Event IDINTEGER

Optional

An incrementing counter to distinguish events with the same user ID and timestamp from each other. Amplitude recommends you send an event ID, increasing over time, especially if you expect events to occur simultanenously.


Insert IDSTRING

Optional

Amplitude will deduplicate subsequent events sent with this ID we have already seen before within the past 7 days. Amplitude recommends generating a UUID or using some combination of device ID, user ID, event type, event ID, and time.


LibrarySTRING

Optional

The name of the library that generated the event.


ProductsOBJECT

Optional

The list of products purchased.


Use Batch EndpointBOOLEAN

Optional

If true, events are sent to Amplitude's batch endpoint rather than their httpapi events endpoint. Enabling this setting may help reduce 429s – or throttling errors – from Amplitude. More information about Amplitude's throttling is available in their docs(link takes you to an external page).


User AgentSTRING

Optional

The user agent of the device sending the event.


User Agent ParsingBOOLEAN

Optional

Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field


Include Raw User AgentBOOLEAN

Optional

Enabling this setting will send user_agent based on the raw user agent string provided in the userAgent field


UTM PropertiesOBJECT

Optional

UTM Tracking Properties


ReferrerSTRING

Optional

The referrer of the web request. Sent to Amplitude as both last touch “referrer” and first touch “initial_referrer”


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id lenght of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.


User Agent DataOBJECT

Optional

The user agent data of device sending the event

Track Revenue Per Product

track-revenue-per-product page anchor
(information)

Info

If you use Track Revenue Per Product, add a revenue property inside the products array of the Order Completed event.

Amplitude has two different ways to track revenue associated with a multi-product purchase. You can choose which method you want to use using the Track Revenue Per Product destination setting.

If you disable the setting ("off"), Segment sends a single revenue event with the total amount purchased and adds revenue data the Amplitude "Order Completed" event. The "Product Purchased" events do not contain any native Amplitude revenue data.

If you enable the setting ("on"), Segment sends a single revenue event for each purchased product and adds Revenue data to each "Product Purchased" event. The "Order Completed" event does not contain any native Amplitude revenue data.

Make sure you format your events using the Track method spec. You must pass a revenue property, a price property, and a quantity property for each product in the products list.

Segment's iOS and Android sources can send revenue using Amplitude's preferred logRevenueV2 method. Segment sets Amplitude's special revenue properties, such as revenueType and productIdentifier, which Amplitude's Revenue Analysis uses for Revenue Analysis and Revenue LTV charts. Segment uses the Amplitude eventProperties field to send any properties not mapped to Amplitude's special properties.

Amplitude PropertySegment PropertyDescription
productIdproductIdAn identifier for the product.
quantityquantityThe quantity of products purchased. Note: revenue = quantity * price.
priceprice or revenue (or total for mobile, see note below)The price of the products purchased, and this can be negative.
revenueTyperevenueTypeThe revenue type (for example tax, refund, income).
receiptSignaturereceiptSignature (Android)The receipt signature.
receiptreceiptRequired if you want to verify the revenue event.
eventPropertiesAny remaining propertiesA NSDictionary or Map of event properties to include in the revenue event.

* If properties.price is not present, Segment uses revenue instead, and sends that as price. In Segment's iOS and Android libraries, if revenue isn't present either, Segment sends the total.

Property names should be camelCase for Android implementations, and snake_case for iOS implementations.

(information)

Info

Amplitude does not support currency conversion. You should normalize all revenue data to your currency of choice before sending it to Amplitude.

(information)

Info

This endpoint is available when you send data in Cloud-mode.

If true, the destination sends events to Amplitude's batch endpoint rather than the httpapi endpoint. Because Amplitude's batch endpoint throttles traffic less restrictively than the Amplitude httpapi endpoint, enabling this setting can help to reduce 429 errors (throttling errors) from Amplitude.

Amplitude's batch endpoint throttles data when the rate of events sharing the same user_id or device_id exceeds an average of 1,000/second over a 30-second period. See the Amplitude documentation for more about 429 errors and throttling in Amplitude(link takes you to an external page).

Set or update properties of particular groups. Note that these updates will only affect events going forward.

Group Identify User is a Cloud action. The default Trigger is type = "group"

Property nameTypeRequiredDescription
User IDSTRING

Optional

A UUID (unique user ID) specified by you. Note: If you send a request with a user ID that is not in the Amplitude system yet, then the user tied to that ID will not be marked new until their first event. If either user ID or device ID is present, an associate user to group call will be made.


Device IDSTRING

Optional

A device specific identifier, such as the Identifier for Vendor (IDFV) on iOS. If either user ID or device ID is present, an associate user to group call will be made.


Insert IDSTRING

Optional

Amplitude will deduplicate subsequent events sent with this ID we have already seen before within the past 7 days. Amplitude recommends generating a UUID or using some combination of device ID, user ID, event type, event ID, and time.


TimestampSTRING

Optional

The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.


Group PropertiesOBJECT

Optional

Additional data tied to the group in Amplitude.


Group TypeSTRING
required

The type of the group


Group ValueSTRING
required

The value of the group


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id length of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.

In the default configuration, Amplitude (Actions) triggers this mapping when it receives a Group call.

(warning)

Warning

Groups are an enterprise feature in Amplitude, and are available if you've purchased the Accounts add-on.

This Action sets or updates the properties of specific groups. You can use this when you want to update a group's information without sending an Event to Amplitude.

These Group updates affect events that occur after you set up the Amplitude mapping. You cannot use this to group historical data.

(success)

Success!

If you are on a Business Tier Segment plan, you can use Replay to run historical data through the Amplitude (Actions) destination to apply the grouping.

If you don't have an enterprise Amplitude account, or don't have the Accounts add-on, Segment always adds groups as user_properties on a user record. As long as you specify the Action settings below, Segment adds a "group type" user property with a value of the "group value".

To use Amplitude's groups with Segment, you must enable the following Action settings and make sure to include the data values they need to function. These settings act as a mapping from Segment group traits to Amplitude group types and values.

  • "Amplitude Group Type Trait": This specifies what trait in your Group calls contains the Amplitude "group type". In other words, it's how you tell Segment which trait to use as the group type.
  • "Amplitude Group Value Trait": This specifies what trait in your Group calls contains the Amplitude "group value". It's how you tell Segment which trait to use as the group value.

Generates a Session ID and attaches it to every Amplitude browser based event.

Session Plugin is a Web action. The default Trigger is type = "track" or type = "identify" or type = "group" or type = "page" or type = "alias"

Property nameTypeRequiredDescription
Session LengthNUMBER

Optional

Time in milliseconds to be used before considering a session stale.


Allow Session TrackingBOOLEAN

Optional

if set to true, 'Session Started' and 'Session Ended' events will be triggered from the user's browser. These events will be forwarded to all connected Destinations.


Session Start EventSTRING

Optional

The event name to use for the session start event.


Session End EventSTRING

Optional

The event name to use for the session end event.

Send an event to Amplitude.

Log Purchase is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
Track Revenue Per ProductBOOLEAN

Optional

When enabled, track revenue with each product within the event. When disabled, track total revenue once for the event.


User IDSTRING

Optional

A readable ID specified by you. Must have a minimum length of 5 characters. Required unless device ID is present. Note: If you send a request with a user ID that is not in the Amplitude system yet, then the user tied to that ID will not be marked new until their first event.


Device IDSTRING

Optional

A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user ID is present. If a device ID is not sent with the event, it will be set to a hashed version of the user ID.


Event TypeSTRING
required

A unique identifier for your event.


Session IDDATETIME

Optional

The start time of the session, necessary if you want to associate events with a particular system. To use automatic Amplitude session tracking in browsers, enable Analytics 2.0 on your connected source.


TimestampDATETIME

Optional

The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.


Event PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data to be sent along with the event. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


User PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data tied to the user. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


GroupsOBJECT

Optional

Groups of users for the event as an event-level group. You can only track up to 5 groups. Note: This Amplitude feature is only available to Enterprise customers who have purchased the Accounts add-on.


App VersionSTRING

Optional

The current version of your application.


PlatformSTRING

Optional

Platform of the device. If using analytics.js to send events from a Browser and no if no Platform value is provided, the value "Web" will be sent.


OS NameSTRING

Optional

The name of the mobile operating system or browser that the user is using.


OS VersionSTRING

Optional

The version of the mobile operating system or browser the user is using.


Device BrandSTRING

Optional

The device brand that the user is using.


Device ManufacturerSTRING

Optional

The device manufacturer that the user is using.


Device ModelSTRING

Optional

The device model that the user is using.


CarrierSTRING

Optional

The carrier that the user is using.


CountrySTRING

Optional

The current country of the user.


RegionSTRING

Optional

The current region of the user.


CitySTRING

Optional

The current city of the user.


Designated Market AreaSTRING

Optional

The current Designated Market Area of the user.


LanguageSTRING

Optional

The language set by the user.


PriceNUMBER

Optional

The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.


QuantityINTEGER

Optional

The quantity of the item purchased. Defaults to 1 if not specified.


RevenueNUMBER

Optional

Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds. Note: You will need to explicitly set this if you are using the Amplitude in cloud-mode.


Product IDSTRING

Optional

An identifier for the item purchased. You must send a price and quantity or revenue with this field.


Revenue TypeSTRING

Optional

The type of revenue for the item purchased. You must send a price and quantity or revenue with this field.


LatitudeNUMBER

Optional

The current Latitude of the user.


LongtitudeNUMBER

Optional

The current Longitude of the user.


IP AddressSTRING

Optional

The IP address of the user. Use "$remote" to use the IP address on the upload request. Amplitude will use the IP address to reverse lookup a user's location (city, country, region, and DMA). Amplitude has the ability to drop the location and IP address from events once it reaches our servers. You can submit a request to Amplitude's platform specialist team here to configure this for you.


Identifier For Advertiser (IDFA)STRING

Optional

Identifier for Advertiser. (iOS)


Identifier For Vendor (IDFV)STRING

Optional

Identifier for Vendor. (iOS)


Google Play Services Advertising IDSTRING

Optional

Google Play Services advertising ID. (Android)


Android IDSTRING

Optional

Android ID (not the advertising ID). (Android)


Event IDINTEGER

Optional

An incrementing counter to distinguish events with the same user ID and timestamp from each other. Amplitude recommends you send an event ID, increasing over time, especially if you expect events to occur simultanenously.


Insert IDSTRING

Optional

Amplitude will deduplicate subsequent events sent with this ID we have already seen before within the past 7 days. Amplitude recommends generating a UUID or using some combination of device ID, user ID, event type, event ID, and time.


LibrarySTRING

Optional

The name of the library that generated the event.


ProductsOBJECT

Optional

The list of products purchased.


Use Batch EndpointBOOLEAN

Optional

If true, events are sent to Amplitude's batch endpoint rather than their httpapi events endpoint. Enabling this setting may help reduce 429s – or throttling errors – from Amplitude. More information about Amplitude's throttling is available in their docs(link takes you to an external page).


User AgentSTRING

Optional

The user agent of the device sending the event.


User Agent ParsingBOOLEAN

Optional

Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field


Include Raw User AgentBOOLEAN

Optional

Enabling this setting will send user_agent based on the raw user agent string provided in the userAgent field


UTM PropertiesOBJECT

Optional

UTM Tracking Properties


ReferrerSTRING

Optional

The referrer of the web request. Sent to Amplitude as both last touch “referrer” and first touch “initial_referrer”


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id lenght of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.


User Agent DataOBJECT

Optional

The user agent data of device sending the event

Send an event to Amplitude

Log Event V2 is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
User IDSTRING

Optional

A readable ID specified by you. Must have a minimum length of 5 characters. Required unless device ID is present. Note: If you send a request with a user ID that is not in the Amplitude system yet, then the user tied to that ID will not be marked new until their first event.


Device IDSTRING

Optional

A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user ID is present. If a device ID is not sent with the event, it will be set to a hashed version of the user ID.


Event TypeSTRING
required

A unique identifier for your event.


Session IDDATETIME

Optional

The start time of the session, necessary if you want to associate events with a particular system. To use automatic Amplitude session tracking in browsers, enable Analytics 2.0 on your connected source.


TimestampDATETIME

Optional

The timestamp of the event. If time is not sent with the event, it will be set to the request upload time.


Event PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data to be sent along with the event. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


User PropertiesOBJECT

Optional

An object of key-value pairs that represent additional data tied to the user. You can store property values in an array, but note that Amplitude only supports one-dimensional arrays. Date values are transformed into string values. Object depth may not exceed 40 layers.


GroupsOBJECT

Optional

Groups of users for the event as an event-level group. You can only track up to 5 groups. Note: This Amplitude feature is only available to Enterprise customers who have purchased the Accounts add-on.


App VersionSTRING

Optional

The current version of your application.


PlatformSTRING

Optional

Platform of the device. If using analytics.js to send events from a Browser and no if no Platform value is provided, the value "Web" will be sent.


OS NameSTRING

Optional

The name of the mobile operating system or browser that the user is using.


OS VersionSTRING

Optional

The version of the mobile operating system or browser the user is using.


Device BrandSTRING

Optional

The device brand that the user is using.


Device ManufacturerSTRING

Optional

The device manufacturer that the user is using.


Device ModelSTRING

Optional

The device model that the user is using.


CarrierSTRING

Optional

The carrier that the user is using.


CountrySTRING

Optional

The current country of the user.


RegionSTRING

Optional

The current region of the user.


CitySTRING

Optional

The current city of the user.


Designated Market AreaSTRING

Optional

The current Designated Market Area of the user.


LanguageSTRING

Optional

The language set by the user.


PriceNUMBER

Optional

The price of the item purchased. Required for revenue data if the revenue field is not sent. You can use negative values to indicate refunds.


QuantityINTEGER

Optional

The quantity of the item purchased. Defaults to 1 if not specified.


RevenueNUMBER

Optional

Revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then (price * quantity) will be used as the revenue value. You can use negative values to indicate refunds. Note: You will need to explicitly set this if you are using the Amplitude in cloud-mode.


Product IDSTRING

Optional

An identifier for the item purchased. You must send a price and quantity or revenue with this field.


Revenue TypeSTRING

Optional

The type of revenue for the item purchased. You must send a price and quantity or revenue with this field.


LatitudeNUMBER

Optional

The current Latitude of the user.


LongtitudeNUMBER

Optional

The current Longitude of the user.


IP AddressSTRING

Optional

The IP address of the user. Use "$remote" to use the IP address on the upload request. Amplitude will use the IP address to reverse lookup a user's location (city, country, region, and DMA). Amplitude has the ability to drop the location and IP address from events once it reaches our servers. You can submit a request to Amplitude's platform specialist team here to configure this for you.


Identifier For Advertiser (IDFA)STRING

Optional

Identifier for Advertiser. (iOS)


Identifier For Vendor (IDFV)STRING

Optional

Identifier for Vendor. (iOS)


Google Play Services Advertising IDSTRING

Optional

Google Play Services advertising ID. (Android)


Android IDSTRING

Optional

Android ID (not the advertising ID). (Android)


Event IDINTEGER

Optional

An incrementing counter to distinguish events with the same user ID and timestamp from each other. Amplitude recommends you send an event ID, increasing over time, especially if you expect events to occur simultanenously.


Insert IDSTRING

Optional

Amplitude will deduplicate subsequent events sent with this ID we have already seen before within the past 7 days. Amplitude recommends generating a UUID or using some combination of device ID, user ID, event type, event ID, and time.


LibrarySTRING

Optional

The name of the library that generated the event.


ProductsOBJECT

Optional

The list of products purchased.


Set OnceOBJECT

Optional

The following fields will only be set as user properties if they do not already have a value.


Set AlwaysOBJECT

Optional

The following fields will be set as user properties for every event.


AddOBJECT

Optional

Increment a user property by a number with add. If the user property doesn't have a value set yet, it's initialized to 0.


Use Batch EndpointBOOLEAN

Optional

If true, events are sent to Amplitude's batch endpoint rather than their httpapi events endpoint. Enabling this setting may help reduce 429s – or throttling errors – from Amplitude. More information about Amplitude's throttling is available in their docs(link takes you to an external page).


User AgentSTRING

Optional

The user agent of the device sending the event.


User Agent ParsingBOOLEAN

Optional

Enabling this setting will set the Device manufacturer, Device Model and OS Name properties based on the user agent string provided in the userAgent field.


Include Raw User AgentBOOLEAN

Optional

Enabling this setting will send user_agent based on the raw user agent string provided in the userAgent field


Minimum ID LengthINTEGER

Optional

Amplitude has a default minimum id length of 5 characters for user_id and device_id fields. This field allows the minimum to be overridden to allow shorter id lengths.


User Agent DataOBJECT

Optional

The user agent data of device sending the event


Migration from Amplitude Classic

migration-from-amplitude-classic page anchor

Keep the following in mind if you plan to move to Amplitude (Actions) from a classic Amplitude destination.

(information)

Info

In some cases, Amplitude Classic uses different default mappings than Amplitude (Actions). For example, the Viewed Home Page event in Amplitude Classic will be Viewed Home in Amplitude Actions, unless you configure it as Viewed Home Page. Be sure to follow the steps in the Destination Actions documentation to customize your mappings. Review how events appear in each destination, and configure the Actions' mappings properly to maintain continuity between Classic and Actions destinations.

Amplitude (Actions) uses Amplitude's HTTP API v2

amplitude-actions-uses-amplitudes-http-api-v2 page anchor
(warning)

Warning

If you used Amplitude Classic in cloud-mode, you'll notice different responses from Amplitude to calls you make with the destination. Classic Amplitude was built on Amplitude's now-deprecated HTTP API v1.

You configure the Amplitude (Actions) destination through Filters and Actions. Consult the table below for information about configuring your Amplitude (Actions) destination similarly to your classic Amplitude destination.

(information)

Info

Contact Segment support if you find features missing from the Amplitude (Actions) destination that were available in the classic Amplitude destination.

Set Once/Set Always fields

set-onceset-always-fields page anchor

Amplitude restricts the mixing of top-level user properties with $set, $setOnce, or $setAlways operations in a single request, as outlined in Amplitude's documentation(link takes you to an external page).

To circumvent this within Segment, users can opt to exclusively map event parameters to either the User Properties field or to one of the user property operations (Set Once and/or Set Always) available in mappings. If you use the Set Once and/or Set Always fields, include all relevant fields in their respective mappings and do not configure mappings for User Properties in the same request.

Conversely, to send top-level user properties, map only to the User Properties field and exclude mappings for the Set Once and Set Always fields.

Amplitude settings mapping

Amplitude Classic Destination SettingHow to enable in Amplitude (Actions)
CONNECTION SETTINGS
API Key
clouddevice-webdevice-mobile

Global Setting

Version Name
device-web

Action field App Version.

Defaults to context.app.version.

Connection Mode
clouddevice-webdevice-mobile

Actions support Cloud mode connections

PAGE AND SCREEN
Track all pages to Amplitude
clouddevice-webdevice-mobile

Subscription Page Calls

When enabled, Amplitude (Actions) tracks all Page calls by default

Track all Screens
clouddevice-webdevice-mobile

Subscription Page Calls

When enabled, Amplitude (Actions) tracks all Screen calls by default

Track Categorized Pages to Amplitude
clouddevice-webdevice-mobile

Subscription Page Calls

Add a Trigger filter condition to check that Event Property category exists

Track Named Pages to Amplitude
clouddevice-webdevice-mobile

Subscription Page Calls

Add a Trigger filter condition to check that Event Property name exists

TRAITS
Group Type Trait
clouddevice-webdevice-mobile

Subscription Group Identify User.

Select a value in the Group Type actions field. This field is mandatory in Amplitude (Actions). In the Amplitude Classic destination, ommiting a value for property field resulted in Amplitude creating a group called [Segment] Group.

Group Value Trait
clouddevice-webdevice-mobile

Subscription Group Identify User.

Select a value in the Group Value actions field. This field is mandatory in Amplitude actions. In the Amplitude Classic destination, ommiting a value for this property resulted in an alpha-numeric value.

OTHER SETTINGS
Batch Events
device-web

Use Batch Endpoint field on the Log Event action

Prefer Anonymous Device ID
clouddevice-webdevice-mobile

Actions field Device ID.

Replace the contents of the field with your preferred value.

Secret Key
clouddevice-webdevice-mobile

Global Setting

Enable Alias
cloud

Use the Map User action.

The Map User action is not enabled by default. Add a new Subscription to access the Map User action.

Send to Batch Endpoint
cloud

Use Batch Endpoint field on the Log Event action

Track Referrer to Amplitude
device-web

Update the User Properties mapping to send context.page.referrer.

Track Revenue per Product
clouddevice-webdevice-mobile

Actions field Track Revenue Per Product.

Available in any subscription that uses the Log Event action. <br /> In Amplitude (Actions), this setting elevates revenue to a top-level property. This allows revenue data to pass through to Amplitude's LTV reports.

Track UTM Properties to Amplitude
clouddevice-web

Supported by default. See the UTM Properties section to view the mappings.

Use Advertising ID for Device ID
clouddevice-webdevice-mobile

Actions field Device ID.

Update the value so your preferred field appears first in the coalesce() function.

Send Custom Language and Country Properties

Actions fields Language and Country

These fields are set by default with values from the context object.


Advanced Amplitude (Actions) settings

advanced-amplitude-actions-settings page anchor

The traitsToIncrement setting increases a user property by some numerical value. If the user property does not have a value set yet, Segment initializes it with a value of 0. The trait must have a numerical value so it can be incremented.

In the following example, the Amplitude User property friendCount equals 4.

1
"traits" : {"$add": {"friendCount": 3} }
2
"traits" : {"$add": {"friendCount": 1} }

FAQs and troubleshooting

faqs-and-troubleshooting page anchor

Does Segment load the Amplitude SDK on the webpage to collect data?

does-segment-load-the-amplitude-sdk-on-the-webpage-to-collect-data page anchor

Segment doesn't load the Amplitude SDK directly on the webpage. Instead, Segment collects data using the Analytics.js library. Once events reach Segment's servers, they are forwarded to Amplitude's servers using Amplitude's HTTP API.

How does Segment handle the Amplitude session ID?

how-does-segment-handle-the-amplitude-session-id page anchor

The Analytics.js library includes a plugin that sets the Amplitude session ID on the device. This session ID is used to track sessions and is automatically attached to events sent to Amplitude. By default, the session ID is set to timeout after 30 minutes of inactivity. You can review the code implementation for setting the session ID(link takes you to an external page).

How can I retrieve the Amplitude session ID set by Segment?

how-can-i-retrieve-the-amplitude-session-id-set-by-segment page anchor

Since Segment doesn't load the Amplitude SDK, the Amplitude native method amplitude.getInstance()._sessionId won't work. You can retrieve the session ID using the this method:

localStorage.getItem('analytics_session_id');

This call accesses the session ID stored in the browser's local storage. You can review the retrieval code(link takes you to an external page).

Why doesn't Segment automatically add the session_id to my Web Events?

why-doesnt-segment-automatically-add-the-session_id-to-my-web-events page anchor

For Segment to automatically add the session_id to your web events, your website must allow the following URL:

https://cdn.segment.com/next-integrations/actions/amplitude-plugins/..

To check if your website allows the URL:

  1. Open your browser's developer tools and inspect the network requests(link takes you to an external page) on your website.
  2. Look for a request related to Amplitude.

If the request is missing:

  • Ensure your browser settings or network configuration allow the URL to load.
  • Check for any third-party script blockers or restrictions that might prevent it.