In the official Firebase Integration Guide (Android) and Firebase Integration Guide (iOS), they have provided individual integration guidelines.
Could you please tell me an ionic way I can integrate Firebase Analytics
into ionic apps?
I need to do this as AdMob made the Firebase Analytics
as its recommendation analytics solution for mobile apps.
Thank you in advance.
Firebase Project Setup If you already got a project, you can also manually enable GA by going to Project settings -> Integration – > Google Analytics within your existing Firebase project! The next step is to add a web, iOS and Android application inside Firebase.
Ionic developers can use Firebase to build rich features into their mobile apps and to monitor and improve app quality over time.
Worth keeping any eye on this thread: https://groups.google.com/forum/#!topic/firebase-talk/MKfIzAtNNuA
In the meantime, an Ionic Native plugin on top of the Cordova plugin cordova-plugin-firebase-analytics has been released: https://ionicframework.com/docs/native/firebase-analytics/
It's still in beta, but I had no problems with it so far (except for a conflict with phonegap-plugin-push). The integration is very straight forward:
import { FirebaseAnalytics } from '@ionic-native/firebase-analytics';
constructor(private firebaseAnalytics: FirebaseAnalytics) { ... }
To track an event just call logEvent:
this.firebaseAnalytics.logEvent('page_view', {page: "dashboard"})
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
Looks like someone created a repository for Firebase in Cordova, you should be able to use that. It says that it will give you at least push notifications, analytics, event tracking, crash reporting.
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