2

如何使用 react native 实施 Google Campaign Measurement

我正在尝试遵循本指南: https ://developers.google.com/analytics/devguides/collection/android/v4/campaigns

我正在采取的步骤

  1. 将 Google Analytics 接收器添加到您的 AndroidManifest.xml 文件中
<application>
    <!-- Used for Google Play Store Campaign Measurement-->
    <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>
    <service android:name="com.google.android.gms.analytics.CampaignTrackingService"
        android:enabled="true"
        android:exported="false" />
</application>
  1. 广播 INSTALL_REFERRER Intent
$ cd <path_to_adb_tool>
$ echo 'am broadcast \
    -a com.android.vending.INSTALL_REFERRER \
    -n "your.package.name/path.to.receiver" \
    --es "referrer" \
      "utm_source=test_source&utm_medium=test_medium&utm_term=test_term&utm_content=test_content&utm_campaign=test_name"; \
    exit' | ./adb shell
  1. 验证活动数据是否已收到 - 无法在 adb 输出中收到以下行 GAv4 : Received installation campaign: source=testSource

我需要做任何额外的步骤来使用 react-native-firebase 做出反应吗?

4

0 回答 0