Dash Stats Docs


public class ReferrerReceiver extends BroadcastReceiver

This class receives the install string from the Play Store.

If you use the AppBrain AAR library (see: Getting started), it will automatically register the ReferrerReceiver in your AndroidManifest:

<receiver android:name="com.appbrain.ReferrerReceiver" android:exported="true">
    <action android:name="com.android.vending.INSTALL_REFERRER"/>

If you have other receivers that you also want to have notified, you can manually register ReferrerReceiver in your AndroidManifest. You can then specify other receivers using meta-data parameters, like for instance in the following snippet, where both the Analytics and AdMob install receivers are notified of a referrer as well (android:name can be any value as long as it starts with “forward.”):

<receiver android:name="com.appbrain.ReferrerReceiver" android:exported="true">
    <action android:name="com.android.vending.INSTALL_REFERRER"/>
  <meta-data android:name="forward.GoogleAnalytics" android:value="com.google.android.apps.analytics.AnalyticsReceiver"/>
  <meta-data android:name="forward.Admob" android:value="com.google.ads.InstallReceiver"/>
  <meta-data android:name="forward.AnotherOne" android:value="com.myapp.CustomReceiver"/>

Alternatively, if you use your own INSTALL_REFERRER receiver, you can remove the AppBrain ReferrerReceiver by adding the following to your AndroidManifest:


Note that for this to work you also need to define the “tools” namespace in your root manifest tag:



public void onReceive(Context context, Intent intent)

Receive the referrer String from the Android market.

public static String retrieve(Context context)

Retrieve the saved referrer String from the Android market.

  • context – The current Android Context

The referrer String, or null of there was none.