Amplitude Actions Destination
Amplitude 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.
This document is about a feature which is in beta. This means that the Destination Actions are in active development, and some functionality may change before it becomes generally available
Good to know: This page is about the Actions-framework Amplitude Segment destination, which receives data from Segment. There’s also a page about the non-Actions Amplitude destination, and the Amplitude Engage Segment source, which sends data to Segment!
Connection Modes for Amplitude Actions destination
The Amplitude (actions) destination does not offer a device-mode connection mode. However if you are using one of Segment’s new libraries (Analytics.js 2.0, Swift or Kotlin) with the Actions-framework version of the destination, you do not need the device-mode connection.
Most previous deployments of the Amplitude Segment destination only used the device-mode connection to get use the session_id
tracking feature. In the new Actions-framework Amplitude destination, session ID tracking is built in. This means you don’t need to bundle any software to run on the user’s device, or write any code. It also means that you can use more of the Segment platform features on data going to Amplitude, such as Protocols filtering and transformations, and Personas identity resolution.
Session tracking is only available when using Segment’s new libraries: Analytics.js 2.0, Swift or Kotlin
Getting Started
- Before you start, go to your Amplitude workspace. Click Settings in the bottom left, then click Projects in the left menu. Select your Project. Copy the Amplitude API Key and Secret Key for the project.
- From the Segment web app, click Catalog, then click Destinations.
- Find the Destinations Actions item in the left navigation, and click it.
- Click the “Amplitude” item to select it and click Configure.
- Choose which of your sources to connect the destination to. (You can connect more sources to the destination later.)
- On the next page enter your Amplitude API key and Secret key and click Verify credentials.
- Next, choose how to create the mapping. You can click Quick Setup to use the defaults provided by Segment, or click Customized Setup to start from a blank mapping.
Once you have a mapping, you can follow the steps in the Destinations Actions documentation on Customizing mappings.
Device ID Mappings
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 the 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
. This is indicated by the following text in the Device ID field: coalesce(
context.device.id
anonymousId
)
.
Enable session tracking for Analytics.js 2.0
The session tracking is automatically enabled on Javascript sources.
Enable session tracking for Swift
To enable session tracking in Amplitude when using the Segment Swift library:
- Enable
trackApplicationLifecycleEvents
in your configuration. - Add the Amplitude Session plugin to your project.
- Initialize the plugin (example)
analytics?.add(plugin: AmplitudeSession(name: "Amplitude"))
Enable session tracking for Kotlin
To enable session tracking in Amplitude when using the Segment Kotlin library:
- Enable
trackApplicationLifecycleEvents
in your configuration. - Add the Amplitude Session plugin to your project.
- Initialize the plugin
analytics.add(AmplitudeSession())
This page was last modified: 06 Jul 2021
Need support?
Questions? Problems? Need more info? Contact us, and we can help!