Skip to content

frichti/AppsFlyer-Segment-Integration

 
 

Repository files navigation

Maven Central


In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com

When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.


What is Segment?

Segment is a customer data hub. You send your data from any device or platform. It is translated and forwarded to your apps in a language they understand.

Segment makes it easy to send your data to AppsFlyer (and lots of other integrations).

AppsFlyer

AppsFlyer lets you understand, engage, monetize and maximize the lifetime value of your app users. Visit Website

The AppsFlyer integration code is open-source on GitHub if you want to check it out.

Getting Started

Once the Segment library is integrated, enable AppsFlyer as one of your Segment integrations (https://segment.com/Your-Workspace-HERE/sources/android/integrations/appsflyer), and add your App Group Identifier and your AppsFlyer Dev Key which you can find in the AppsFlyer Dashboard under App Settings > Developer Console.

The Segment AppsFlyer integration is entirely handled through Segment's servers, so you don’t need to bundle AppsFlyer's iOS or Android SDKs. Your Segment SDK will be enough.

AppsFlyer supports the identify and track methods.

Identify

When you identify a user, that user’s information is passed to AppsFlyer with customer user Id as AppsFlyer’s External User ID. Segment’s special traits recognized as AppsFlyer’s standard user profile fields (in parentheses) are:

  • customerUserId (Customer User Id)
  • currencyCode (Currency Code)

All other traits will be sent to AppsFlyer as custom attributes.

Track

When you track an event, the event is sent to AppsFlyer as a custom event.

Completed Order

When you track an event with the name Completed Order using the e-commerce tracking API, the products you’ve listed are sent to AppsFlyer as purchases.

Android

Integrating

1. Add the AppsFlyer Segment Integration dependency to your app build.gradle:

compile 'com.appsflyer:segment-android-integration:1.+'

It is recommended to use the latest version on Maven since it contains the most up-to-date features and bug fixes.

NOTE: Our Group ID is com.appsFlyer and not com.segment.analytics.android.integrations.

2. Next, declare AppsFlyer’s integration in your Analytics instance:

Analytics analytics = new Analytics.Builder(this, "Your-Segment-Write-Key")
        .use(AppsflyerIntegration.FACTORY)
        ...
        .build();

In-App Messages

No further action is required to integrate in-app messages, which are registered for and requested by default by our AppsFlyer Segment integration.

Sample App

AppsFlyer has created a sample Android application that integrates AppsFlyer via Segment. Check it out at the Github repo.

About

AppsFlyer's Android SDK - Segment Integration

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%