且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase分析计算的用户数量少于实际数量

更新时间:2023-12-02 13:42:46

答案是这样的: p>

FireBase分析对于静态分析是不够的,不计算没有Google帐户的手机。我们必须使用谷歌分析跟踪ID来获取精确的结果。然后,firebase可以附加该跟踪器ID以使用FireBase功能。



阅读这个

分开的项目和特定的电话。每天我测试应用程序,并等到明天(24小时)查看结果。这大约需要一个星期。在这里他们是:

第一个实验:

用firebase 4项目检查实施是否影响用户数量。在所有这些项目中,我把生成的JSON文件,并把

$ $ p $ classpath'com.google.gms:google-services:3.0.0 '

在项目级gradle中作为依赖关系,它们是:


  1. 没有任何实现的FireBase核心。 (只是在gradle中放置依赖,而不是在代码中使用它)




  compile'c​​om.google.firebase:firebase-core:10.0.1'





  1. 没有任何实现的FireBase崩溃报告。




  compile'c​​om.google.firebase:firebase-crash :10.0.1'




    $ b $


     编译b 
  1. FireBase消息传递,无需任何实现。 'com.google.firebase:firebase-messaging:10.0.1'




  2. 带有分析功能的Fire Base,不需要任何实现




  compile'c​​om.google.android.gms:play-services-analytics:10.2.6'


我用两个android手机测试了这4个应用程序,其中一个带有Google帐户,另一个没有任何帐户。 b $ b

结果:24小时之后的
所有这些应用程序静态都显示在FireBase面板上,所以我发现没有必要在Application类中实现FireBase。因此,如果您想在FireBase中使用默认的跟踪功能,那么这表明我的实现是正确的,并且完全不需要任何实现。
但是,只有使用Google用户帐户的电话(以用户身份计算),并且只有一个针对 first_open 事件的事件!即使是在 audience / user_property / device_model 中追踪的电话,这也是我的主要问题。所以我开始了第二个实验。

第二个实验
在第二个实验中,我把Analytics Tracker ID放在其中一个项目中是谷歌分析和FireBase计数用户相同或不。

FireBase帐户和Google Analytics帐户是不同的。例如,我使用帐户 x@gmail.com 在FireBase中创建了项目,并将由帐户 y@gmail.com 创建的分析跟踪器ID (请注意,此跟踪器ID之前在另一个项目中使用过,但尚未激活,因为Google说只能使用一个跟踪器ID跟踪许多应用)。在这个时候,我有 5个电话,两个与谷歌帐户,一个与myCustomAccount(没有谷歌帐户)和三个没有帐户。我想检查是否有帐户是重要的,或者只需要谷歌帐户。
在实时面板中,我看到3〜4(5)的活跃用户,总是失去1〜2,所以我记得我忘记了:

 < uses-permission android:name =android.permission.INTERNET/> 
<使用权限android:name =android.permission.ACCESS_NETWORK_STATE/>谷歌分析文档说,你必须把这些权限。把这些权限后实时面板显示我所有的手机! (这很奇怪,Google Analytics(分析)会计算我的活动手机没有这些权限,是否可以从Firebase收集数据,真的我不知道)
$ b

结果:两个与谷歌帐户显示在Firebase中与一个没有帐户的手机!但Google Analytics数据是空的。没有新用户,真的什么也没有。这是非常令人惊讶的,因为我昨天在分析实时面板中看到我所有的手机!

第三个实验:
I创建了一个像 z@gmail.com 这样的新的Google帐户,并且FireBase和Google Analytics跟踪代码都来自此帐户。




I Have a app that loaded for statics with FireBase and TapStream. My app is not distributed from google play or other app stores. I should pay third party corporation that shared my app per installation. The count of install declared by third-party is about to TapSteram statics count. but unfortunately Firebase is so different. ( I check firebase Firest-open event for new install).

for example:

  • Third-party says people installed (or click for download your app) are 300
  • TapStream says that there are 229 new Installs
  • FireBase says 28 First-open!!

I use FireBase like this in gradle:

compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'

In application class:

public static FirebaseAnalytics mFirebaseAnalytics;
@Override
public void onCreate() {
    super.onCreate();
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
}

Am I using FireBase wrong or FireBase is not enough for Statics and I should add Google Analytic lib like we did in past before FireBase ( add tracker and ...)?

Answer is this:

FireBase analytics is not enough for statics and it not count phones without Google account. We have to use google analytics Tracker ID for precis result. Then firebase can attach on that tracker ID for using of FireBase features.

read this

For finding a right answer i do 3 experience with separated project and with specific phones. every day i test the apps and wait till tomorrow (24 h) for see results. It take about one week. and here they are:

First experiment:

At first step I tried 4 project with firebase to checkout if implementation is affects on user counts or not. In all these project i put generate json file and put

classpath 'com.google.gms:google-services:3.0.0'

in project level gradle as dependency and here they are:

  1. FireBase core without any implemention. (just put dependency in gradle and not use it in code)

compile 'com.google.firebase:firebase-core:10.0.1'

  1. FireBase crash report without any implemention.

compile 'com.google.firebase:firebase-crash:10.0.1'

  1. FireBase messaging without any implemention.

compile 'com.google.firebase:firebase-messaging:10.0.1'

  1. Fire base with analytics without any implemention

compile 'com.google.android.gms:play-services-analytics:10.2.6'

I tested these 4 apps with two android phone, one with Google account on it and one without any account on it.

Result: after 24 hours all these apps statics appears on FireBase panel so I findout there is no need for Implement of FireBase in Application class. So it shows that my implemention was right and exactly there is no need for any implemention, if you want to use default tracking feature in FireBase! But Only phone with the google user account, counted as user and there is only one event for first_open event! even just that phone tracked in audience/user_property/device_model and this is my main problem. so i started second experiment.

Second experiment: In second experiment I put Analytics Tracker ID in one of these project to see is Google analytics and FireBase count users same or not.

FireBase account and Analytics account was different. For example I created project in FireBase with account x@gmail.com and put a analytics tracker ID created by account y@gmail.com (Note that this tracker ID was used before in another project but it was not active yet and as google says you can track many apps with just one Tracker ID). In this time i had 5 phones, two with google account, one with myCustomAccount (without google account) and three with no accounts. I want to check if having account is important or it just need google account. In real-time panel I see 3 ~ 4 (of 5) active user and always 1 ~ 2 is missing, so I remembered that i forgotten to put :

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Google analytics doc says you had to put these permissions. after put these permissions Real-time panel show all of my phones! (This is odd that Analytics count my active phones without these permissions, may it gather data from Firebase, really I do not know)

Result: Two phones with google account shown in Firebase with one of no-account phones! but Analytics data was empty. there is no new user, and really nothing. that was very surprising cause i see all of my phones yesterday in real-time panel of analytics!

Third experiment: I created a new google account like z@gmail.com and both FireBase and Analytics tracker ID was from this account.

Result: Fire base and analytics show proper 5 phones, new user, active user, first_open event and every thing matches.