Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

appsflyer not called onAppOpenAttribution after first install

Deferred Deeplinking NOT working. I am using appsflyer, Android 5.1.1, Android Studio 2.3.3

in build.gradle:

compile 'com.appsflyer:af-android-sdk:4.8.3@aar'

in Application:

@Override
public void onCreate() {
    super.onCreate();

    AppsFlyerConversionListener conversionDataListener = new AppsFlyerConversionListener() {
        @Override
        public void onInstallConversionDataLoaded(Map<String, String> conversionData) {
            Log.d(TAG, "onInstallConversionDataLoaded");
            if (conversionData != null) {
                Log.d(TAG, conversionData.toString());
                Log.d(TAG, conversionData.keySet().toString());
                Log.d(TAG, conversionData.values().toString());
            }
        }

        @Override
        public void onInstallConversionFailure(String errorMessage) {
            if (errorMessage == null) {
                Log.d(TAG, "null");
            } else {
                Log.d(TAG, errorMessage);
            }
        }

        @Override
        public void onAppOpenAttribution(Map<String, String> attributionData) {
            Log.d(TAG, "onAppOpenAttribution");
            if (attributionData != null) {
                Log.d(TAG, attributionData.toString());
                Log.d(TAG, attributionData.keySet().toString());
                Log.d(TAG, attributionData.values().toString());
            }
        }

        @Override
        public void onAttributionFailure(String errorMessage) {
            if (errorMessage == null) {
                Log.d(TAG, "null");
            } else {
                Log.d(TAG, errorMessage);
            }
        }
    };

    AppsFlyerLib.getInstance().setDebugLog(true);
    AppsFlyerLib.getInstance().init(AF_DEV_KEY, conversionDataListener);
    AppsFlyerLib.getInstance().startTracking(this, "application");
}

in AndroidManifest.xml

<receiver
        android:name="com.appsflyer.MultipleInstallBroadcastReceiver"
        android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="detail"
                android:scheme="prayer" />
        </intent-filter>

    </activity>

All about code is these, I public the app to Google Play Store. After the app can been seen, I click https://test5.onelink.me/B3qk?pid=test6&c=test7&af_dp=prayer%3A%2F%2Fdetail%2Ftest2&af_web_dp=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcn.renyuzhuo.testreferrer to download the app, bug I can't get the Attributes.

The very first open app, onInstallConversionDataLoaded is called, and I can see the log is

onInstallConversionDataLoaded
{af_message=organic install, af_status=Organic}
[af_message, af_status]
[organic install, Organic]

and if I click the url after the app is installed, I can see the log is:

onAppOpenAttribution
{af_android_url=https://play.google.com/store/apps/details?id=cn.renyuzhuo.testreferrer, af_deeplink=true, campaign=test7, media_source=test6, install_time=2017-10-24 06:21:29, af_status=Non-organic, path=/test2, scheme=prayer, host=detail}
[af_android_url, af_deeplink, campaign, media_source, install_time, af_status, path, scheme, host]
[https://play.google.com/store/apps/details?id=cn.renyuzhuo.testreferrer, true, test7, test6, 2017-10-24 06:21:29, Non-organic, /test2, prayer, detail]

It is not the same. And after I read the doc https://support.appsflyer.com/hc/en-us/articles/207032176-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deeplinking-. I hope the install by click the url, the very first open can get the Attribution like the click after install.

Where I did wrong? Thank you.

like image 860
RenYuZhuo Avatar asked Nov 19 '22 06:11

RenYuZhuo


1 Answers

From your description it seems you have not whitelisted your test device, as explained here: https://support.appsflyer.com/hc/en-us/articles/207031996--Whitelisting-a-Test-Device

After whitelisting the test device, make sure you remove the application from your phone, before testing once more.

If this is not the case (device is whitelisted, but non-organic conversion data is not returned) please open a support ticket by mailing to [email protected]

like image 135
Benjamin Weinstein Avatar answered Dec 31 '22 18:12

Benjamin Weinstein