Làm cách nào để chuyển từ Google-Analytics sang Firebase-Analytics?


85

Lý lịch

Trong những tháng gần đây, Google đã xuất bản một giải pháp thay thế Analytics mới, được gọi là " Firebase Analytics ".

Vấn đề

Vì ứng dụng đã có Google-Analytics, tôi thấy một số trở ngại mà tôi không thể biết cách xử lý tốt nhất.

Những câu hỏi

  1. Trước đây, hàm "newTracker" cần id thuộc tính. Bây giờ tôi không thấy nó. Nó có nghĩa là nó không cần một cái?

  2. Trước đây, "enableAdvertisingIdCollection" cũng có sẵn để thu thập thông tin quảng cáo. Tôi không thể tìm thấy nó trong các API mới. Nó có được tự động thu thập không?

  3. "setDryRun" đã có sẵn để vô hiệu hóa việc gửi dữ liệu đến máy chủ và bây giờ tôi không thấy nó. Nó có nghĩa là nó tự động theo cách này để gỡ lỗi các phiên bản của ứng dụng? Tất cả các chức năng có ghi vào nhật ký không?

  4. Trước đây, tôi có thể theo dõi một "màn hình":

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

    Bây giờ tôi không thấy nó, nhưng khi tôi đã đọc, tôi nghĩ nó tự động, vì vậy dù sao thì nó cũng gửi dữ liệu về vòng đời hoạt động. Có đúng không?

  5. Có lẽ điều quan trọng nhất: trước đây tôi có thể theo dõi bằng cách sử dụng danh mục, hành động, nhãn và giá trị:

    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 = 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:

    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 ?

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

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

    adb shell setprop log.tag.FA VERBOSE adb shell setprop log.tag.FA-SVC VERBOSE adb logcat -v time -s FA 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?


1
Why vote for closing? :(
android developer

1
Side note, I have been researching Firebase Analytics and just implemented it on my react-native app. It appears that it is being rebranded as "Google Analytics for Firebase" firebase.google.com/docs/analytics
myself

iS GOOGLE analytics deprecated for web ?
Ahmad Arslan

@AhmadArslan I don't know
android developer

Câu trả lời:


56

Lots of questions bundled 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. Firebase Analytics reports AdId automatically. You don't need to enable it.
  3. 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.
  4. You can report screens with

    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);
    
  5. You can log custom event with the same params

    Bundle params = new Bundle();
    params.putString("category", category);
    params.putString("action", action);
    params.putString("label", label);
    params.putLong("value", value);
    firebaseAnalytics.logEvent("xyz_event", params);
    

    The "ga_" prefix is reserved and your analytics will fail if you use it. Instead, use "xyz_" where xyz is your company's initials, for example.

    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 than that will cause some of your data to be ignored.

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

  7. 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.

  8. 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.


3
5. It seems it's not supported yet to use custom bundle stuff, according to these posts: stackoverflow.com/a/37779048 , stackoverflow.com/a/37511858 . Too bad.
android developer

1
Thanks for the comment. Changed value to long in 5. There is no automatic reporting on all params yet but you can link the account to BigQuery and use that to create reports. BigQuery has some free quota that might be all you need. Abotu 3. The default is reporting. 4. Screen reporting is not automatic. You need to log the event when you display content. 5. If the default reporting is not sufficient you can query the data in BigQuery. It has the raw events as you logged them. 6. You should ignore app_uninstall. 7. If you enable debug logging on a device you will see all logs.
djabi

1
8. This is very broad question. What particular features you are asking about. If Firebase Analytics is identical to Google Analytics it will be Google Analytics not Firebase Analytics.
djabi

2
'The "firebase_", "google_", and "ga_" prefixes are reserved and should not be used.': firebase.google.com/docs/reference/cpp/group/parameter-names My suggestion instead of "ga_event" would be "abc_event" where "abc" is an acronym for you or your company.
KRA2008

5
I landed here as it is now 2019 and Google are soon deprecating GA in favour of FA, so the move is mandatory. support.google.com/firebase/answer/9167112
Ryan

13

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.

How to move from google analytics to firebase analytics?

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.

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

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

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

  • If you were using GA extensively before, chances are that you would be missing some of its feature when switching completely to FA.
  • 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.

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).

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


11
I landed here as it is now 2019 and Google are soon deprecating GA in favour of FA, so the move is mandatory. support.google.com/firebase/answer/9167112
Ryan

1
So this means we have to use Firebase Analytics instead of Google Analytics? Am i correct?
Sumit Shukla

@Ryan holy cow! I wanted to go to Google Analytics from Firebase Analytics, but Your comment saved me! Thanks!
Aleksandar
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.