Reputation: 5691
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.
Upvotes: 17
Views: 11504
Reputation: 1244
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));
Upvotes: 3
Reputation: 8062
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.
Upvotes: 2
Reputation: 277
Worth keeping any eye on this thread: https://groups.google.com/forum/#!topic/firebase-talk/MKfIzAtNNuA
Upvotes: 3