我正在尝试向我的应用程序添加一个推荐跟踪系统,以便我能够知道我的附属合作伙伴中的谁派用户下载我的程序。我遇到了几个写过它的网站,但仍然无法理解一些问题。
我已将此添加到我的 list 中<receiver android:name="com.cool.PlayStoreReferralReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
并创建了这个对象:
public class PlayStoreReferralReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
if (extras != null) {
String referrerString = extras.getString("referrer");
Log.d("DEBUG", "Set Value:"+referrerString);
}
}
}
它似乎工作正常,但我有 2 个问题
https://play.google.com/store/apps/details?id=com.joelapenna.foursquared&referrer=utm_source%3Dtooyoou%26utm_medium%3Dbanner%26utm_term%3Dfoursquare%26utm_content%3Dfoursquare-tooyoou%26utm_campaign%3Dfoursquare-android
不要那样做:
https://play.google.com/store/apps/details?id=com.joelapenna.foursquared&referrer=affiliate1
非常感谢,
或者。
最佳答案
对于那些需要知道的人:
Referral Tester
工作得很好。 referrer
之后的任何内容参数关于Android玩市场推荐了解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13790159/