如何从google分析转向firebase分析?

时间:2021-09-08 13:50:21

Background

In the recent months, Google has published a new Analytics alternative, called "Firebase Analytics" .

最近几个月,谷歌发布了一种新的分析方法,叫做“Firebase Analytics”。

The problem

As the app already does have Google-Analytics, I find some obstacles that I can't see how to best handle.

由于这款应用已经有了谷歌分析功能,我发现了一些我无法很好地处理的障碍。

The questions

  1. Previously, "newTracker" function needed a property-id. Now I don't see it. Does it mean it doesn't need one?

    之前,“newTracker”函数需要一个属性id。现在我看不到了。这是否意味着它不需要一个呢?

  2. Previously, "enableAdvertisingIdCollection " was available to collect ads info too. I can't find it in new APIs. Is it automatically collected?

    以前,“enableAdvertisingIdCollection”也可用于收集广告信息。我在新的api中找不到。它是自动收集吗?

  3. "setDryRun" was available to disable sending the data to the servers, and now I don't see it. Does it mean it's automatically this way for debug versions of the app? Do all functions write to the logs?

    “setDryRun”可用来禁用向服务器发送数据,现在我看不到它了。这是否意味着在调试版本的应用程序中它是自动地使用这种方式的呢?所有的函数都写日志吗?

  4. Previously, I could track a "screen" :

    之前,我可以跟踪一个“屏幕”:

    public void setScreenName(String name) {
        mGoogleAnalyticsTracker.setScreenName(name);
        mGoogleAnalyticsTracker.send(new HitBuilders.ScreenViewBuilder().build());
    }
    

    Now I don't see it, but as I've read, I think it's automatic, so it sends data of the activity lifecycle anyway. Is it true?

    现在我没有看到它,但是我已经读过了,我认为它是自动的,所以它还是发送了活动生命周期的数据。是真的吗?

  5. Probably the most important thing: previously I could track using category, action, label and value:

    可能最重要的是:之前我可以跟踪使用类别、动作、标签和值:

    public void trackEvent(final String category, final String action, final String label, final long value) {
        mGoogleAnalyticsTracker.send(new HitBuilders.EventBuilder()
                .setCategory(category).setAction(action)
                .setLabel(label).setValue(value).build());
    }
    

    and now I see a completely different way to track events ("custom events"), using bundles. Example :

    现在我看到了一种完全不同的方式来使用bundle来跟踪事件(“自定义事件”)。例子:

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
    

    How does it work? How is it shown in the website of Firebase Analytics? I suppose I could have the first parameter of logEvent behave like the category parameter of the Google-Analytics, but what can/should I do for the rest? According to the docs, this should be ok:

    它是如何工作的呢?Firebase Analytics网站是如何显示的?我想我可以让logEvent的第一个参数像Google-Analytics的category参数一样运行,但是我可以/应该为剩下的做什么呢?根据医生的说法,这应该没问题:

    public void trackEvent(final String category, final String action, final String label, final long value) {
        Bundle bundle = new Bundle();
        bundle.putString("action", action);
        bundle.putString("label", label);
        bundle.putLong("value", value);
        mFirebaseAnalytics.logEvent(category, bundle);
    }
    
  6. Which events are actually automatically being tracked (I ask this because some are said that I shouldn't use, here) ? Do they include purchases? app-invites? ads? Where do I see them in the console website ?

    哪些事件实际上是自动被跟踪的(我问这个问题是因为有人说我不应该在这里使用)?他们包括购买吗?app-invites吗?广告吗?我在控制台的网站上看到了什么?

  7. About logs, it says that the new SDK does it by :

    关于日志,它说新的SDK是:

    You can enable verbose logging with a series of adb commands:

    您可以使用一系列adb命令启用详细日志记录:

    adb shell setprop log.tag.FA VERBOSE adb shell setprop log.tag.FA-SVC VERBOSE adb logcat -v time -s FA FA-SVC

    亚行壳记者log.tag。FA详细的adb shell setprop log.tag。FA- svc冗长的adb logcat -v时间-s FA- svc

    What do those commands do? How can I disable it? I've noticed it even gets shown in release version of the app...

    这些命令做什么?如何禁用它?我注意到它甚至会出现在这个应用的发布版本中……

  8. Is the new SDK supposed to replace Google-Analytics? Is it suggested to fully move to it? Will Google-Analytics have any updates?

    新的SDK会取代Google-Analytics吗?是否建议完全转向它?谷歌分析有什么更新吗?

2 个解决方案

#1


25  

Lots of questions bundles together so I'll try to briefly answer most of them:

很多问题交织在一起,所以我会试着简单地回答其中的大部分:

  1. Google Analytics reports on tracker-ids, Firebase Analytics reports on applications. There is only one id in the application defined in your google-services.json. The ID is translated to a string resource by google services plugin under "google_app_id" name. All events from the app are reported to this single id.
  2. 谷歌分析报告关于tracker-ids, Firebase分析报告关于应用程序。在google-services.json中定义的应用程序中只有一个id。ID通过谷歌服务插件在“google_app_id”名称下翻译为字符串资源。应用程序中的所有事件都报告给这个单一id。
  3. Firebase Analytics reports AdId automatically. You don't need to enable it.
  4. Firebase分析报告自动生成。您不需要启用它。
  5. There is no dryRun feature. You can either use separate google-services.json during development, filter out development version using the app version or add user-property to mark the app instances used for development.
  6. 没有dryRun功能。您可以使用单独的google服务。在开发过程中,使用应用程序版本筛选开发版本,或者添加用户属性来标记用于开发的应用程序实例。
  7. You can reports screens with
  8. 您可以使用屏幕报告
Bundle params = new Bundle(); params.putString(FirebaseAnalytics.PARAM.ITEM_CATEGORY, "screen");
params.putString(FirebaseAnalytics.PARAM.ITEM_NAME, "screen name");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, params);
  1. You can log custom event with the same params
  2. 您可以使用相同的参数记录自定义事件
Bundle params = new Bundle();
params.putString("category", category);
params.putString("action", action);
params.putString("label", label);
params.putLong("value", value);
firebaseAnalytics.logEvent("ga_event", params);

Do not use the category as event name unless you have very few categories you want to track. Firebase Analytics supports up to 500 event names. Logging more then that will cause some of your data to be ignored.

不要将类别用作事件名称,除非您希望跟踪的类别非常少。Firebase分析支持最多500个事件名。然后再进行日志记录,会导致一些数据被忽略。

  1. There is a list of reserved event names in the beginning of the FirebaseAnalytics.Event class. It roughly represent the automatic events reported.

    在FirebaseAnalytics开始部分有一个保留事件名称的列表。事件类。它大致表示所报告的自动事件。

  2. Firebase Analytics has debug logging disabled by default. It only logs errors and warnings. If you don't enable debug logging and your app is correctly configured there are only 2 lines that are being logged when the app starts with instructions on how to enable debug logging. There is nothing to disable in production and there is no equivalent to setLogLevel(ERROR) from Google Analytics. WARN is the default logging level. You can only enable logging on individual device by running the adb command on the device). That helps you avoid shipping app in production with debug logging enabled.

    Firebase Analytics默认禁用了调试日志记录。它只记录错误和警告。如果您不启用调试日志记录,并且您的应用程序配置正确,那么在应用程序开始时,只有两行记录日志记录,说明如何启用调试日志记录。在生产环境中没有什么要禁用的,也不存在与谷歌分析中的setLogLevel(ERROR)相等的东西。警告是默认的日志记录级别。您只能通过在设备上运行adb命令在单个设备上启用日志记录)。这可以帮助您避免在启用调试日志的情况下生产应用程序。

  3. Google Analytics SDK for Android and iOS is not deprecated and will be supported and updated for foreseeable future. You don't need to move away from it if you already invested using it in your app and it is meeting your needs.

    针对Android和iOS的谷歌分析SDK没有被弃用,在可预见的未来将会被支持和更新。如果你已经在你的应用中使用了它,并且它满足了你的需求,你就不需要离开它。

#2


7  

Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic.1 Google launched the service in November 2005 after acquiring Urchin. Firebase is a cloud services provider and backend as a service company based in San Francisco, California. The company makes a number of products for software developers building mobile or web applications.

谷歌分析是谷歌提供的一项免费增值网络分析服务,跟踪和报告网站流量。谷歌在收购了Urchin之后于2005年11月推出了这项服务。Firebase是一家位于加州旧金山的云服务提供商和后端服务公司。该公司为构建移动或web应用程序的软件开发人员制造了许多产品。

**How to move from google analytics to firebase analytics ? Answer :-**Google Analytics (GA) and Firebase Analytics (FA), despite their common name, are widely different in many aspects. While GA is a general-purpose (and more web oriented) analytics tool, Firebase was built keeping mobile in mind: therefore, the feature set is different between the two, with some things that were added in FA and things that are missing from GA.

**如何从谷歌分析到firebase分析?答案:-**谷歌分析(GA)和Firebase分析(FA)虽然有共同的名字,但在很多方面都有很大的不同。虽然GA是一种通用的(更面向web的)分析工具,但是在构建Firebase时,要记住移动功能:因此,特性集在FA中添加了一些东西,并且在GA中缺少了一些东西。

More specifically, these are some noteworthy points when considering Firebase Analytics:

更具体地说,在考虑Firebase分析时,以下几点值得注意:

1) Real-time view is missing 2) Events are available after a 4-6 hours period 3) Behavior Flow (from GA) is missing 3) The Audiences feature a big advantage of FA and, coupled with Notifications, allows you to engage with a specific group of users 4) When using Firebase Crash Reporting, an audience with users who experienced a crash is automatically created 5) Funnel analysis makes much more sense than in GA, since FA is based on events and not on screen views 5) Free and unlimited, except for the number of types of events (limited to 500); no limits on the volume of events per each type 6) Some events are logged automatically (i.e., sessions based on Activity lifecycle) 7)Relatively low methods footprint, compared to GA's methods count 8) Dead-easy to setup, there is no singleton to initialize, just include the Gradle dependency and start logging events 9) All-in-one console, if you plan on using other Firebase services

1)实时视图丢失2)事件后4 - 6小时内可用3)行为流(GA)缺失3)观众特性FA的一大优势,再加上通知,允许你与一个特定的用户组4)当使用重火力点崩溃报告,观众和用户经验的崩溃是自动创建5)漏斗分析比遗传算法更有道理,因为FA是基于事件而不是屏幕视图5)*和无限的,除事件类型(限制为500)外;每个类型的事件的数量没有限制)有些事件被自动记录(例如。(基于活动生命周期的会话)相对较低的方法内存占用,与GA的方法相比,它的设置非常简单,不存在单例初始化,只包括Gradle依赖项和启动日志事件9)All-in-one控制台,如果您计划使用其他的Firebase服务。

As to if one should consider switching from one to the other, or if to keep both in parallel, the answer is: it depends.

如果一个人应该考虑从一个人切换到另一个人,或者如果要让两者同时进行,答案是:这要视情况而定。

1) If you were using GA extensively before, chances are that you would be missing some of its feature when switching completely to FA. 2) However, if this is a fresh start for your project, FA is much more prone to a cross-platform mobile-oriented environment, so you may very well consider it as your own analytics tool.

1)如果您以前大量使用GA,那么当您完全切换到FA时,很可能会丢失它的一些特性。2)然而,如果这是你的项目的一个新的开始,FA更倾向于跨平台的移动环境,所以你可能会认为它是你自己的分析工具。

On a side note, keep in mind that Firebase has just launched and Google has plans on adding more features in the coming weeks (e.g., real-time dashboard).

另一方面,记住Firebase刚刚发布,谷歌计划在未来几周增加更多的功能(如实时仪表板)。

For tutorial you can find here https://firebase.google.com/docs/analytics/android/start/

对于教程,您可以在这里找到https://firebase.google.com/docs/analytics/android/start/

#1


25  

Lots of questions bundles together so I'll try to briefly answer most of them:

很多问题交织在一起,所以我会试着简单地回答其中的大部分:

  1. Google Analytics reports on tracker-ids, Firebase Analytics reports on applications. There is only one id in the application defined in your google-services.json. The ID is translated to a string resource by google services plugin under "google_app_id" name. All events from the app are reported to this single id.
  2. 谷歌分析报告关于tracker-ids, Firebase分析报告关于应用程序。在google-services.json中定义的应用程序中只有一个id。ID通过谷歌服务插件在“google_app_id”名称下翻译为字符串资源。应用程序中的所有事件都报告给这个单一id。
  3. Firebase Analytics reports AdId automatically. You don't need to enable it.
  4. Firebase分析报告自动生成。您不需要启用它。
  5. There is no dryRun feature. You can either use separate google-services.json during development, filter out development version using the app version or add user-property to mark the app instances used for development.
  6. 没有dryRun功能。您可以使用单独的google服务。在开发过程中,使用应用程序版本筛选开发版本,或者添加用户属性来标记用于开发的应用程序实例。
  7. You can reports screens with
  8. 您可以使用屏幕报告
Bundle params = new Bundle(); params.putString(FirebaseAnalytics.PARAM.ITEM_CATEGORY, "screen");
params.putString(FirebaseAnalytics.PARAM.ITEM_NAME, "screen name");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, params);
  1. You can log custom event with the same params
  2. 您可以使用相同的参数记录自定义事件
Bundle params = new Bundle();
params.putString("category", category);
params.putString("action", action);
params.putString("label", label);
params.putLong("value", value);
firebaseAnalytics.logEvent("ga_event", params);

Do not use the category as event name unless you have very few categories you want to track. Firebase Analytics supports up to 500 event names. Logging more then that will cause some of your data to be ignored.

不要将类别用作事件名称,除非您希望跟踪的类别非常少。Firebase分析支持最多500个事件名。然后再进行日志记录,会导致一些数据被忽略。

  1. There is a list of reserved event names in the beginning of the FirebaseAnalytics.Event class. It roughly represent the automatic events reported.

    在FirebaseAnalytics开始部分有一个保留事件名称的列表。事件类。它大致表示所报告的自动事件。

  2. Firebase Analytics has debug logging disabled by default. It only logs errors and warnings. If you don't enable debug logging and your app is correctly configured there are only 2 lines that are being logged when the app starts with instructions on how to enable debug logging. There is nothing to disable in production and there is no equivalent to setLogLevel(ERROR) from Google Analytics. WARN is the default logging level. You can only enable logging on individual device by running the adb command on the device). That helps you avoid shipping app in production with debug logging enabled.

    Firebase Analytics默认禁用了调试日志记录。它只记录错误和警告。如果您不启用调试日志记录,并且您的应用程序配置正确,那么在应用程序开始时,只有两行记录日志记录,说明如何启用调试日志记录。在生产环境中没有什么要禁用的,也不存在与谷歌分析中的setLogLevel(ERROR)相等的东西。警告是默认的日志记录级别。您只能通过在设备上运行adb命令在单个设备上启用日志记录)。这可以帮助您避免在启用调试日志的情况下生产应用程序。

  3. Google Analytics SDK for Android and iOS is not deprecated and will be supported and updated for foreseeable future. You don't need to move away from it if you already invested using it in your app and it is meeting your needs.

    针对Android和iOS的谷歌分析SDK没有被弃用,在可预见的未来将会被支持和更新。如果你已经在你的应用中使用了它,并且它满足了你的需求,你就不需要离开它。

#2


7  

Google Analytics is a freemium web analytics service offered by Google that tracks and reports website traffic.1 Google launched the service in November 2005 after acquiring Urchin. Firebase is a cloud services provider and backend as a service company based in San Francisco, California. The company makes a number of products for software developers building mobile or web applications.

谷歌分析是谷歌提供的一项免费增值网络分析服务,跟踪和报告网站流量。谷歌在收购了Urchin之后于2005年11月推出了这项服务。Firebase是一家位于加州旧金山的云服务提供商和后端服务公司。该公司为构建移动或web应用程序的软件开发人员制造了许多产品。

**How to move from google analytics to firebase analytics ? Answer :-**Google Analytics (GA) and Firebase Analytics (FA), despite their common name, are widely different in many aspects. While GA is a general-purpose (and more web oriented) analytics tool, Firebase was built keeping mobile in mind: therefore, the feature set is different between the two, with some things that were added in FA and things that are missing from GA.

**如何从谷歌分析到firebase分析?答案:-**谷歌分析(GA)和Firebase分析(FA)虽然有共同的名字,但在很多方面都有很大的不同。虽然GA是一种通用的(更面向web的)分析工具,但是在构建Firebase时,要记住移动功能:因此,特性集在FA中添加了一些东西,并且在GA中缺少了一些东西。

More specifically, these are some noteworthy points when considering Firebase Analytics:

更具体地说,在考虑Firebase分析时,以下几点值得注意:

1) Real-time view is missing 2) Events are available after a 4-6 hours period 3) Behavior Flow (from GA) is missing 3) The Audiences feature a big advantage of FA and, coupled with Notifications, allows you to engage with a specific group of users 4) When using Firebase Crash Reporting, an audience with users who experienced a crash is automatically created 5) Funnel analysis makes much more sense than in GA, since FA is based on events and not on screen views 5) Free and unlimited, except for the number of types of events (limited to 500); no limits on the volume of events per each type 6) Some events are logged automatically (i.e., sessions based on Activity lifecycle) 7)Relatively low methods footprint, compared to GA's methods count 8) Dead-easy to setup, there is no singleton to initialize, just include the Gradle dependency and start logging events 9) All-in-one console, if you plan on using other Firebase services

1)实时视图丢失2)事件后4 - 6小时内可用3)行为流(GA)缺失3)观众特性FA的一大优势,再加上通知,允许你与一个特定的用户组4)当使用重火力点崩溃报告,观众和用户经验的崩溃是自动创建5)漏斗分析比遗传算法更有道理,因为FA是基于事件而不是屏幕视图5)*和无限的,除事件类型(限制为500)外;每个类型的事件的数量没有限制)有些事件被自动记录(例如。(基于活动生命周期的会话)相对较低的方法内存占用,与GA的方法相比,它的设置非常简单,不存在单例初始化,只包括Gradle依赖项和启动日志事件9)All-in-one控制台,如果您计划使用其他的Firebase服务。

As to if one should consider switching from one to the other, or if to keep both in parallel, the answer is: it depends.

如果一个人应该考虑从一个人切换到另一个人,或者如果要让两者同时进行,答案是:这要视情况而定。

1) If you were using GA extensively before, chances are that you would be missing some of its feature when switching completely to FA. 2) However, if this is a fresh start for your project, FA is much more prone to a cross-platform mobile-oriented environment, so you may very well consider it as your own analytics tool.

1)如果您以前大量使用GA,那么当您完全切换到FA时,很可能会丢失它的一些特性。2)然而,如果这是你的项目的一个新的开始,FA更倾向于跨平台的移动环境,所以你可能会认为它是你自己的分析工具。

On a side note, keep in mind that Firebase has just launched and Google has plans on adding more features in the coming weeks (e.g., real-time dashboard).

另一方面,记住Firebase刚刚发布,谷歌计划在未来几周增加更多的功能(如实时仪表板)。

For tutorial you can find here https://firebase.google.com/docs/analytics/android/start/

对于教程,您可以在这里找到https://firebase.google.com/docs/analytics/android/start/