I want to track the install referrer.
User will click the below promotional link from mobile --
market://details?id=com.s2s.doupnow&clickid=sdKrF5
The clickid is getting generated automatically, here i am showing a sample clickid.
This link is taking the user to playstore so that the user can install the app.
In the app i used com.android.vending.INSTALL_REFERRER so that i can read the clickid when the app is installed and opened. To implement this i am using the below code, which will read the clickid and store it in the database --
public class InstallReferrerReceiver extends BroadcastReceiver {
String result2 = null;
private UserLoginTask2 mAuthTask2 = null;
@Override
public void onReceive(Context context, Intent intent) {
String referrer = intent.getStringExtra("clickid");
Log.d("ClickID",referrer);
mAuthTask2 = new UserLoginTask2(referrer);
mAuthTask2.execute((Void) null);
}
}
In manifest file added the below code --
<receiver
android:name=".InstallReferrerReceiver"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
But after installing the app from playstore using the above link, i am not getting the value of clickid in the database.
Can anybody guide me where i am going wrong.