AppsFlyer Destination

Segment makes it easy to send your data to AppsFlyer (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to AppsFlyer in the format they understand. Learn more about how to use AppsFlyer with Segment.

AppsFlyer helps marketers to pinpoint targeting, optimize ad spend and boost ROI.

Getting Started

Mobile Components

The Segment<>AppsFlyer SDK must be packaged in your app for both iOS and Android. The most detailed steps for setting up AppsFlyer via Segment may be found in each Github repo: iOS app and Android app

Server-Side Components

AppsFlyer offers an augmentative server side HTTP API intended for use along side their mobile SDK. Use the server side destination alongside the mobile SDK to associate out-of-app events such as website or offline purchases with attributed users/devices. Please read further for more information on this functionality.

Important: Keep in mind that the server side destination is not meant to supplant the client side SDK! In order for AppsFlyer to properly attribute, you must bundle their mobile SDK! The server side destination should not be used alone. Also, keep in mind if you are passing in appsFlyerId for server-side calls, you will not be able to disable events from sending to AppsFlyer via your Segment dashboard.

If you’d like to use AppsFlyer fully server side, this can be done but it is a Enterprise Customer Feature and you need to contact your AppsFlyer representative to enable this feature.

Dashboard steps

To enable AppsFlyer in Segment dashboard, take the following steps:

  • Enter your unique AppsFlyer Dev Key, which is accessible from your AppsFlyer account, in Segment’s destination settings.
  • Follow the instructions in the Github repos: iOS SDK and Android SDK
  • After you build and release to the app store, we start translating and sending your data to AppsFlyer automatically.

Important: If you plan on using the server side destination for an Android project, please make sure to enter your Android App ID. If you are using only the mobile SDK, Android projects only require the AppsFlyer Dev Key. iOS projects always require both the AppsFlyer Dev Key and the Apple App ID. Also, note that if you do use the server side destination, you will not be able to selectively disable calls sent to AppsFlyer via your Segment dashboard.


When you call .identify(), we will use AppsFlyer’s setCustomerUserID to send the userId that was passed in.

identify calls are not supported via AppsFlyer’s HTTP API at the moment. You can only send .identify calls if you have the AppsFlyer SDK bundled.


When you call track, we translate it automatically and send the event to AppsFlyer.

We include all the event properties as callback parameters on the AppsFlyer event, and automatically translate properties.revenue to the appropriate AppsFlyer purchase event properties based on our spec’d properties.

Finally, we automatically use AppsFlyer’s transactionId-based de-duplication when you send an an orderId (see the e-commerce spec).

Server-Side Tracking

If you’d like to attribute offline events with a certain user or device, the server side destination may be employed.

AppsFlyer requires the following properties for this attribution:

AppsFlyer Device ID

Send the AppsFlyer Device ID with each event at integrations.AppsFlyer.appsFlyerId, see example below. This identifier is unique to each device and can be retrieved using the AppsFlyer SDK. It is a good idea to store this value in an external database where it may be easily accessible by a server or website environments.

Device Type

AppsFlyer requires the user’s device type as either 'ios' or 'android', passed at context.device.type object, see example below.

Advertising ID (Optional)

AppsFlyer recommends passing an Advertising ID (referred to as IDFA on iOS and Advertising ID on Android) at context.device.advertisingId, see example below.

// node.js library example
  event: 'Membership Upgraded',
  userId: '97234974',
  context: {
    device: {
      type: 'ios',
      advertisingId: '159358'
  integrations: {
    AppsFlyer: {
      appsFlyerId: '1415211453000-6513894'

Check your specific serverside library docs for specifics on how to format the method properly.

Finally, the serverside component will look for the following properties and handle them specially:

  • ip (this should be the ip of your customer–this is not collected by Segment’s libraries out-of-the-box)
  • timestamp (refer to AppsFlyer’s docs on how they process timestamps. Since our libraries generate a timestamp, we will always set this value)
  • currency (defaults to "USD")
  • revenue (For Order Completed / Completed Order events, precedence is given to total, falling back to properties.revenue)

All other properties will be sent to AppsFlyer as custom properties inside eventValue.

Note: Be sure to calibrate/update the time window in AppsFlyer’s dashboard to see your events!

Install Attributed


Segment will automatically trigger an Install Attributed event if you have trackAttributionData enabled in your settings, and the Segment-AppsFlyer integration installed in your app. The event payload will adhere to our Install Attributed event specification documented here and will propagate to your other downstream destinations.


If you are tracking events server-side, AppsFlyer can still send attribution postbacks but you will need to configure this functionality in your AppsFlyer account. To enable this, navigate to your AppsFlyer app and on the sidebar of the main screen click on Integrated Partners and search for Segment. You will be prompted with a couple of configuration options and asked to input your Segment Write Key. Once enabled, successfully attributed app installs will begin showing up as Install Attributed events similar to the client side behavior documented above.

If you are sending in the attribution data yourself, for iOS be sure the following properties are sent in within the campaign object on the Install Attributed or Application Opened event so Appsflyer can correctly attribute it as an Apple Search Ad event. These values should be returned by the Apple Search Ads API:

"campaign": {
        "content": "keyword1keyword2",
        "ad_creative": "OrgName",
        "conversion_date": "2018-03-07T04:05:50Z",
        "ad_group": "US-iOS-campaign-Exact",
        "id": "123",
        "ad_group_id": "456",
        "name": "US-iOS-campaign",
        "click_date": "2018-03-06T04:05:50Z",

For example, an attribution event coming from an attribution partner would look like:

[[SEGAnalytics sharedAnalytics] track:@"Install Attributed", properties: @{
    @"provider" : @"Appsflyer/Tune/Kochava/Branch",
    @"campaign" : @{
        @"source" : @"Network/FB/AdWords/MoPub/Source",
        @"name" : @"Campaign Name",
        @"content" : @"Organic Content Title",
        @"ad_creative" : @"Red Hello World Ad",
        @"ad_group" : @"Red Ones",
        @"conversion_date": @"2018-03-07T04:05:50Z",
        @"id": @"123",
        @"ad_group_id": @"456",
        @"click_date": @"2018-03-06T04:05:50Z",

Other Features

Revenue Tracking

The destination automatically recognizes spec’d revenue property and translates them to AppsFlyer’s revenue tracking method.

Transaction De-duplication

The destination automatically recognizes the spec’d orderId property, and sends it as the transaction id to AppsFlyer for revenue de-duplication.

In-App Purchase Receipts

The destination does not currently support in-app purchase receipts. If this is important to you, please email


The destination does not automatically support out-of-the-box deeplinking (you need to write code here regardless!).

Therefore, you can use AppsFlyer’s OneLink integration which is a single, smart, tracking link that can be used to track on both Android and iOS. OneLink tracking links can launch your app when it is already installed instead of redirecting the user to the app store.

For more details, please review the AppsFlyer OneLink Setup Guide. More information is available in the AppsFlyer SDK Integration Guides (iOS, Android) and Segment’s mobile FAQs (iOS, Android).

Supported Sources and Connection Modes

📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

Segment offers an optional Device-based Connection Mode for Mobile data with AppsFlyer. If you’d like to use those features that require client-based functionality, follow the steps above to ensure you have packaged the AppsFlyer SDK with Segment’s.


Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

Android App ID

Your Android App’s ID. Find this in your AppsFlyer’s ‘My App’ dashboard. It should look something like ‘com.appsflyer.myapp’. This is required for Android projects if you want to send events using the server side integration.

Apple App ID (iOS)

Your App’s ID, which is accessible from iTunes or in AppsFlyer’s ‘My App’ dashboard. This is optional for Android projects, and only required for iOS projects.

AppsFlyer Dev Key

Your unique developer ID from AppsFlyer, which is accessible from your AppsFlyer account.

Enable HTTP fallback (Android)

If selected, HTTPS calls will fallback on HTTP

Roku App ID

IMPORTANT: In order to send Roku data, you must contact your AppsFlyer representative as this type of data stream requires a full server to server integration which is available but is gated as a AppsFlyer Enterprise Customer feature. Without AppsFlyer’s consent we are unable to forward your Roku data. Your Roku App’s ID. Find this in your AppsFlyer’s ‘My App’ dashboard. This is required for Roku projects if you want to send events using the server side integration.

Track Attribution Data

Send attribution data to Segment and other tools as a track call (mobile libraries only).

If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!