1

谷歌在什么情况下会返回这种格式的 utm_source=(not%20set)&utm_medium=(not%20set) 。

请让我知道是否有任何文档可以检查代码是否正常工作?

使用新的谷歌推荐 api。

try {
            mReferrerClient = InstallReferrerClient.newBuilder(this).build();
            mReferrerClient.startConnection(new InstallReferrerStateListener() {
                @Override
                public void onInstallReferrerSetupFinished(int responseCode) {
                    switch (responseCode) {
                        case InstallReferrerClient.InstallReferrerResponse.OK:
                            // Connection established

                            ReferrerDetails response = null;
                            try {
                                response = mReferrerClient.getInstallReferrer();

                                refer = response.getInstallReferrer();

                                setData(refer, intent);

                                Log.e("refergoogle", refer);
                                response.getReferrerClickTimestampSeconds();
                                response.getInstallBeginTimestampSeconds();
                                mReferrerClient.endConnection();


                            } catch (Exception e) {
                                Crashlytics.logException(e);
                            }
                            break;
                        case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
                            // API not available on the current Play Store app
                            break;
                        case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE:
                            // Connection could not be established
                            break;
                    }
                }

                @Override
                public void onInstallReferrerServiceDisconnected() {
                    // Try to restart the connection on the next request to
                    // Google Play by calling the startConnection() method.
                }
            });
        } catch (Exception e) {
            Crashlytics.logException(e);
        }

为实时应用打印的日志是 E/original-reff: utm_source=(not%20set)&utm_medium=(not%20set)

4

1 回答 1

0

根据我的观察,“未设置”通常发生在通过 FaceBook 安装的情况下。

于 2021-07-16T07:33:56.617 回答