I’m trying to add to my app a referral tracking system so I would be able to know who of my affiliates partner sent the user to download my program. I’ve encounter several websites who write about it but still failed to understand some issues.
I’ve added this to my menifest
<receiver android:name="com.cool.PlayStoreReferralReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
and created this object:
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);
}
}
}
It seems to be working fine but I have 2 questions
- I dont understand why I need to build a link which look like that for example:
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
and not do it my way like that:
https://play.google.com/store/apps/details?id=com.joelapenna.foursquared&referrer=affiliate1
- I’ve been checking it with the program ‘Referral Tester’ and it seems to work is that safe enough to relay on ?
Thanks so much,
Or.
For those who need to know:
Referral Testerworking great.you can get the referral like that : https://play.google.com/store/apps/details?id=com.joelapenna.foursquared&referrer=affiliate1 or basicly anything after the
referrerparameter