Determine whether a user installed our app via Market link

余生颓废 提交于 2019-12-05 04:54:50

It is possible to use Google Analytics to track the usage of your App.

On Android Google Analytics provides a refferal tracking. This should enable you to create a link for each of the sites that link to your app and track how much apps where installed because of which site.

Look at the Tracking Referrals chapter from the Android Google Analytics Documentation for more information.

You have to rely on the Google Analytics jar that has to be called within the app and registered in the manifest.xml

Update

If you don't want to use a separate jar you could try to obtain the referral information yourself. Google analyticss work through registering this Intent filter:

<!-- Used for install referrer tracking -->
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver" android:exported="true">
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>

It seems that the market app will send the specified intent just after installing an app from the market. The intent then will be catched from the AnalyticsReciever class and they will save the referrer for later use in the analytics.

Google states that this is how it works:

The Android 1.6 OS release supports the use of a referrer URL parameter in download links to the Android Market. The Google Analytics SDK for Android uses this parameter to automatically populate referral/campaign information in Google Analytics for your application. This enables the source of the application install to be recorded and associated with future pageviews and events.

This also means that the sites linking to you app have to include a specific parameter in the market url. How this is done is also explained in the Google Analytics Documentation.

Afaik no.

However you could use URL shortening service that remembers HTTP referer, then you would share that URL with the websites. One such service is referer.us.

Or you could roll your own on AppEngine (reliable & free) with HttpRedirectFilter.

Edited:

Pls take a look at @Janusz post. He presented the right solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!