简体   繁体   中英

How to Track App Installs?

我想跟踪我的应用程序的所有安装,因为我会将其上传到WebSite而不是PlayStore上进行下载,而不是将其下载到PlayStore,因此我已经阅读了有关Google Analytics(分析)的信息,但我不想跟踪屏幕等所有信息。方式/库或跟踪我的应用安装的方式...

create a service for your mobile App in your website. whenever a user download application from website and installs it. Then hit that service from your mobile app. The service when receives the request from your application store it in the database. make sure that your database table contains a unique identifier for eg device id/mac address. in order to track installs

You cant track install from the app. You can get phone identifier and hit some backend endpoint with it. You can use Google Analytics events for this, this is the simplest way. Also you can track downloads from site and use it as an install event, cause i don't think that there will be many users who will download app, but not install it.

You can use Firebase Analytics to track all the Installs of App

Documentation is here

You need to create an BroadcastReceiver like this in manifiest file

<receiver
            android:name="com.domain.package.CustomReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

and receive into a class like this

public class CustomReceiver extends BroadcastReceiver{

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
          Bundle b= intent.getExtras();
             String referrerString = b.getString("referrer");
            // Log.e("bundle", "bundle= " + referrerString+ " " + referrerString.substring(11, referrerString.length()));
             SharedPrefManager.setPrefVal(context, Constants.REFERRAL, referrerString.substring(11, referrerString.length()));

    }
}

and at this point you will get an referrer link from the playstore. you just need to save and send this to server using webservices. so that you can track your app installs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM