关注此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>
答案 0 :(得分: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.CampaignTrackingReceiver
更改为com.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"