Android-跟踪应用程序首次在设备上启动的时间
当应用程序首次在设备上启动时,我需要跟踪以下代码:, 然而,它与我从谷歌分析中获得的新用户类别的数据不匹配。有人能在代码中看到任何不可靠的东西吗?例如,今天我看到这段代码中有3个安装,但我有5个新用户只能从GooglePlay下载这个应用Android-跟踪应用程序首次在设备上启动的时间,android,google-analytics,Android,Google Analytics,当应用程序首次在设备上启动时,我需要跟踪以下代码:, 然而,它与我从谷歌分析中获得的新用户类别的数据不匹配。有人能在代码中看到任何不可靠的东西吗?例如,今天我看到这段代码中有3个安装,但我有5个新用户只能从GooglePlay下载这个应用 String INSTALL_SOURCE = "Google Play"; TelephonyManager tm; tm = (TelephonyManager) getBaseContext().getSystemServ
String INSTALL_SOURCE = "Google Play";
TelephonyManager tm;
tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
String INSTALL_COUNTRY = tm.getSimCountryIso();
prefs = getSharedPreferences("user_stats", MODE_PRIVATE);
boolean firstTime = prefs.getBoolean("isFirstTime", true);
if (firstTime) {
rentracker.trackEvent("Install Source", INSTALL_SOURCE, INSTALL_COUNTRY, 1);
Editor editor = prefs.edit();
editor.putBoolean("isFirstTime", false);
editor.commit();
}
Log.d(TAG, "Is this the first time?: " + firstTime);
String android_id = Secure.getString(this.getContentResolver(),
Secure.ANDROID_ID);
rentracker.trackEvent("App Startup - " + INSTALL_SOURCE, INSTALL_COUNTRY, "ID: " + android_id,1);
有人能在代码中看到任何不可靠的东西吗
rentracker
应该通过互联网进行通信,但不是每个人都可以连续访问互联网。因此,可能是您的代码已经运行,但后端尚未发现,因为用户当时不在线这可能不是问题,但有一个词是关于Secure.ANDROID_ID的唯一性!也许有些用户从Google Play安装了这个应用程序,但从来没有启动它让你的代码运行?你的第三点可能是我对这个问题的最好答案。我一直认为他们的数据是准确的。