Test referral tracking

Before you begin tracking user acquisition campaigns on Android, Localytics recommends that you validate that your app is successfully passing referrer parameters to the Localytics SDK.

Note: The definitive test is to submit the application to the Google Play Store, construct a URL, and see the data on the Localytics Dashboard. This isn’t practical during development, so the easiest way to do this is to use adb to send the installation intent. Once connected via adb shell the following command will send the intent.
am broadcast -a com.android.vending.INSTALL_REFERRER -n <your.package.name>/com.localytics.android.ReferralReceiver --es "referrer"
"utm_source%3Dtest_source%26utm_medium%3Dtest_medium%26utm_term%3Dtest_term%26utm_content%3Dtest_content%26utm_campaign%3Dtest_name"
  1. Navigate to the Localytics Dashboard and create a new campaign.
  2. Choose a descriptive test campaign name, like "AttributionTest."
  3. Select Add a custom source... in the Sources menu. Pick an acquisition source name, such as "AttributionTestSource."
  4. Click Save.
  5. Copy the referral URL that Localytics generates.

    The referral URL is formatted as follows.

    http://a.localytics.com/android?id=YOUR_ANDROID_PACKAGE&referrer=utm_source%3DAttributionTestSource%26utm_campaign%3DAttributionTest1

    YOUR_ANDROID_PACKAGE is your app's Android Package (e.g."com.localytics.testapp")

  6. Locate an Android device that has never previously installed your app. Open a web browser on your Android device and navigate to the referral URL you constructed.
    You are redirected to the Google Play Store.
  7. Install and run your app. Then, change apps to trigger the Localytics SDK to upload a new session from your device.

Wait a few minutes. If your app is configured correctly, you should see a new user in the Localytics Dashboard in Attribution, where acquisition source is "AttributionTestSource."