6

遵循此https://developers.google.com/analytics/solutions/testing-play-campaigns

logcat 总是报告:未找到活动数据。

这是我的 AndroidManifest.xml

<!-- Used for Google Play Store Campaign Measurement -->
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver
  android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
  android:exported="true" >
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>
4

1 回答 1

19

经过几个小时的搜索。

最后,我自己找到了答案。

adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n 
com.example.gatestapp/com.google.analytics.tracking.android.CampaignTrackingReceiver
--es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"

该文档似乎使用旧 SDK 中的代码。

你必须从 更改com.google.analytics.tracking.android.CampaignTrackingReceivercom.google.android.gms.analytics.CampaignTrackingReceiver

这就是它的样子

adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n     
com.example.gatestapp/com.google.android.gms.analytics.CampaignTrackingReceiver
--es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"
于 2014-05-03T20:22:16.733 回答