2

Google 即将弃用 intall_referrer 意图。我发现谷歌分析 CampaignTrackingReceiver 在我们的项目中使用它。从清单中添加代码以供参考:

        <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
        android:enabled="true"
        android:exported="true"
        android:permission="android.permission.INSTALL_PACKAGES">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

如何用 Firebase 分析替换它?

4

2 回答 2

0

在这里找到了答案:

活动衡量

检查上面的链接,这是与旧使用方式匹配的代码部分CampaignTrackingReceiver

// Tracker for Classic GA (call this if you are using Classic GA only)
    private void trackInstallReferrer(final String referrerUrl) {
        new Handler(getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                CampaignTrackingReceiver receiver = new CampaignTrackingReceiver();
                Intent intent = new Intent("com.android.vending.INSTALL_REFERRER");
                intent.putExtra("referrer", referrerUrl);
                receiver.onReceive(getApplicationContext(), intent);
            }
        });
    }
于 2020-03-08T09:33:09.513 回答
0

从代码中删除 Google Analytics 安装引荐来源网址广播。它将停止向https://analytics.google.com/analytics发送推荐人数据。但这不会有问题,我们可以在项目中配置 Firebase 并跟踪活动数据。请查看此视频 - https://www.youtube.com/watch?v=lvADer1CfEs

于 2020-03-11T14:34:33.633 回答