RudderStack is a customer data pipeline tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.
More information on RudderStack can be found here.
-
Add AppsFlyer as a destination in the Dashboard and define
devKey
-
Add these lines to your
app/build.gradle
repositories {
maven { url "https://dl.bintray.com/rudderstack/rudderstack" }
}
- Add the dependency under
dependencies
implementation 'com.rudderstack.android.sdk:core:[1.2.1,)'
implementation 'com.rudderstack.android.integration:appsflyer:[2.2.0,)'
// appsflyer dependencies
implementation 'com.appsflyer:af-android-sdk:6.4.3'
implementation 'com.android.installreferrer:installreferrer:1.1.1' // for attribution
- Initialize Appsflyer SDK in the
Application
class before initializing the Rudder SDK as shown below:
import com.appsflyer.AppsFlyerLib
import com.appsflyer.AFLogger;
AppsFlyerLib.getInstance().init(<DEV_KEY>, null, this);
AppsFlyerLib.getInstance().setLogLevel(AFLogger.LogLevel.DEBUG);
AppsFlyerLib.getInstance().start(this);
val rudderClient: RudderClient = RudderClient.getInstance(
this,
<WRITE_KEY>,
RudderConfig.Builder()
.withDataPlaneUrl(<DATA_PLANE_URL>)
.withFactory(AppsFlyerIntegrationFactory.FACTORY)
.build()
)
Use this snippet after initialising RudderClient
rudderClient.onIntegrationReady("AppsFlyer") {
val appsflyerId = AppsFlyerLib.getInstance().getAppsFlyerUID(this)
println("=====================================================")
println("AppsFlyer ID: $appsflyerId")
println("=====================================================")
}
Follow the steps from the RudderStack Android SDK.
If you come across any issues while configuring or using this integration, please feel free to start a conversation on our Slack channel. We will be happy to help you.