To retrieve the Install Referrer from your Android App Context, you must add an additional receiver at your AndroidManifest.xml. The receiver is called upon every time an app install is either generated from AppsFlyer's tracking links or has a referrer parameter.
Adding the Receiver
Android apps cannot have multiple receivers that have the same intent-filtered action. However, AppsFlyer provides a solution that broadcasts INSTALL_REFERRER to all other receivers automatically.
In the AndroidManifest.xml, add the following receiver as the FIRST for INSTALL_REFERRER, and your other receivers just below it:
AppsFlyer Install Receiver is first and broadcasts to all receivers placed below it.
<receiver android:name="com.appsflyer.MultipleInstallBroadcastReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> <!—All Other receivers should follow right after --> <receiver android:name="MyReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver>
Your new receiver (MyReceiver) is called upon every time an install is either generated from AppsFlyer's tracking links or has a referrer parameter.
AF tracking link used to install the app:
af_tranid is an AppsFlyer internal transaction ID. All the rest of the parameters are taken directly from the installation URL query string.
Follow the normal test procedure here. The expected referrer string is: