This preview of pull request 1734 is meant for internal use only.

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

  1. 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.
  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.)
  6. On the next page enter your Amplitude API key and Secret key and click Verify credentials.
  7. 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:

  1. Enable trackApplicationLifecycleEvents in your configuration.
  2. Add the Amplitude Session plugin to your project.
  3. 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:

  1. Enable trackApplicationLifecycleEvents in your configuration.
  2. Add the Amplitude Session plugin to your project.
  3. Initialize the plugin
    analytics.add(AmplitudeSession())
    

This page was last modified: 06 Jul 2021



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account