title: com.android.vending.INSTALL_REFERRER
body: <p>I want to track the install referrer.</p>
  
  <p>User will click the below promotional link from mobile --</p>
  
  <pre><code>market://details?id=com.s2s.doupnow&amp;clickid=sdKrF5
  </code></pre>
  
  <p>The clickid is getting generated automatically, here i am showing a sample clickid.</p>
  
  <p>This link is taking the user to playstore so that the user can install the app.</p>
  
  <p>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 --</p>
  
  <pre><code>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);
      }
  }
  </code></pre>
  
  <p>In manifest file added the below code --</p>
  
  <pre><code>&lt;receiver
              android:name=".InstallReferrerReceiver"
              android:exported="true"
              android:permission="android.permission.INSTALL_PACKAGES"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.android.vending.INSTALL_REFERRER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  </code></pre>
  
  <p>But after installing the app from playstore using the above link, i am not getting the value of clickid in the database. </p>
  
  <p>Can anybody guide me where i am going wrong.</p>