Skip to main content

Firebase And Google Analytics

Description

The custom event log is very useful to understand how users interact with the app. Some library utilities can record useful events in Firebase and Google Analytics.

note

Event logging in Firebase and Google Analytics is optional and is disabled by default.

important

If you enable custom event logging, all logs will be visible in your Firebase or Google Analytics project. This event log is intended for you to analyze how the user interacts with your application. Events are only sent to the Firebase account you have configured in your project.


Configuration

important

If you want to enable event logging, your project must have Firebase Analytics configured and optionally Google Analytics enabled. Guide.

To enable library custom event log, you must define the Firebase Analytics instance, this must be done in the onCreate() of the application class or in the main activity. When assigning the instance, the record of events will be enabled for all library utilities.

Base.firebaseAnalyticsInstance = FirebaseAnalytics.getInstance(context)

In case you want to disable the event log for a specific utility, it can be done by:

MoreApps.firebaseAnalyticsEnabled = false

In the example, the MoreApps utility does not log events to Firebase Analytics, but all the other utilities will.


Event list

The following list shows the events that the library can log and their description.

note

Some events have parameters. For an analysis of these parameters, custom dimensions and metrics can be created in Firebase or Google Analytics console.


About App


about_app_shown

The about activity is shown to the user.
about_app_osl_shown

The open source licenses are shown in the about activity.
about_app_terms_policy_shown

The license terms and privacy policy are shown in the about activity.

More Apps


more_apps_shown_google_play_ok

The user is directed to Google Play, to the list of the developer apps.
more_apps_shown_google_play_error

It is not possible to direct the user to the developer apps list in Google Play.

Premium App


billing_check_premium_client

The premium state of the app is verified directly with the Google Play billing client.
billing_check_premium_preferences

The premium state of the app is verified through the preferences, since it was not possible to do so through the Google Play billing client.
billing_client_connection_ok

billing_client_connection_error

billing_client_disconnected

They indicate if the connection with the Google Play billing client could be established, and if the connection was lost at any time.
billing_sku_details_ok

billing_sku_details_error

They indicate whether or not the details of a product could be obtained.
billing_flow_launch_ok

billing_flow_launch_error

They indicate if the purchase flow could or could not be started.
billing_purchase_cancelled

The purchase was canceled, either by the user or because the payment method was rejected or an error occurred.
billing_purchase_completed

billing_purchase_acknowledge_error

Indicates if the purchase was completed successfully or if there was an error on acknowledged it. These events are always emitted after the payment is approved.

Rate App


rate_app_flow_request_ok

rate_app_flow_request_error

They indicate whether or not the review flow could be obtained.
rate_app_flow_launch_ok

rate_app_flow_launch_error

Indicates whether or not the review flow could be launched (show to the user).
rate_app_flow_shown

The flow to invite the user to rate the app was shown (the review API does not provide the result, but it can be inferred, although it is not 100% accurate).
rate_app_dialog_shown

The dialog to rate the app was shown, it only applies in versions prior to Android 5 where the revision API is not available.
rate_app_sent_google_play_app

rate_app_sent_google_play_web

rate_app_sent_google_play_error

They indicate where the user was directed to rate the app. And the last event indicates that the user could not be directed to either the Google Play app or the website.

System Web Browser


open_url_system_web_browser

The user is directed to a web page in the system web browser.

open_url_case

Parameter that indicates the reason why the user was directed to the system web browser, and also records when an error occurs.