I don´t want to send any special logs to the Firebase Analytics console, just check in which screens is the user spending more time and so on.
When I used AnalyticsTracker
it was compulsory to add it everywhere, so do you can set the specific name of every screen with the Tracker.xml
file.
The official documentation says:
Add the dependency for Firebase Analytics to your app-level
build.gradle
file:
compile 'com.google.firebase:firebase-core:9.2.1'
Declare the FirebaseAnalytics object at the top of your activity:
private FirebaseAnalytics mFirebaseAnalytics;
Then initialize it in the
onCreate()
method:
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
So I guess I´ve to do this in every page where I want to get data, haven´t I?
Declare the FirebaseAnalytics object at the top of your activity: private FirebaseAnalytics mFirebaseAnalytics; Then initialize it in the onCreate() method: mFirebaseAnalytics = FirebaseAnalytics.
Firebase Analytics will store logged evens locally on the device (online or offline). When its time to upload the data and the devices has network connection Firebase Analytics will batch the data in as fewer uploads as possible, compress it and attempt to upload the data.
Google analytics also supported mobile analytics though android and IOS sdk's which sent Screen hits to google analytics. There was a difference between Mobile and web google analytics accounts. Firebase is a platform developed by Google for creating mobile and web applications.
No. You just need to create global variable in an Class which extends Application class
public class MyApplication extends Application { public static FirebaseAnalytics mFirebaseAnalytics; @Override public void onCreate() { super.onCreate(); mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); } }
After, you add the following line in your manifest, in the Application tag
<application android:name=".MyApplication" ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With