5

延迟深层链接不起作用。我正在使用appsflyer、Android 5.1.1、Android Studio 2.3.3

在 build.gradle 中:

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

在应用中:

@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");
}

在 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>

所有关于代码的都是这些,我将应用程序公开到 Google Play 商店。可以看到应用后,我点击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下载应用,bug 我无法获取属性。

第一个打开的应用程序onInstallConversionDataLoaded被调用,我可以看到日志是

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

如果我在安装应用程序后单击 url,我可以看到日志是:

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]

这是不一样的。在我阅读文档https://support.appsflyer.com/hc/en-us/articles/207032176-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deeplinking-之后。我希望通过点击 url 安装,第一次打开可以像安装后点击一样获得 Attribution。

我哪里做错了?谢谢你。

4

2 回答 2

0

在我们的应用程序中使用带有 Segment 的 AppsFlyer 时,我也遇到了同样的问题。您是否也在您的应用中使用 Segment?如果是,那么AppsFlyerConversionListener直接在您的代码中使用将不起作用。您必须通过 Segment wrapper SDK 使用它,如此处所述https://support.appsflyer.com/hc/en-us/articles/210041606#how-does-the-sdk-wrapper-work。这是一些示例代码,解释了我们如何使用包装器https://github.com/AppsFlyerSDK/AppsFlyer-Segment-Integration/tree/master/segmenttestapp/src/main/java/com/appsflyer/segment/app。如果您不清楚,您可以要求澄清。

于 2019-11-04T12:43:14.520 回答
0

根据您的描述,您似乎没有将测试设备列入白名单,如下所述: https: //support.appsflyer.com/hc/en-us/articles/207031996--Whitelisting-a-Test-Device

将测试设备列入白名单后,请确保在再次测试之前从手机中删除该应用程序。

如果不是这种情况(设备已列入白名单,但未返回非自然转换数据),请通过邮寄至 support@appsflyer.com 打开支持票

于 2017-10-25T08:15:12.663 回答