17

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.

Sagar Ranglani
  • 5,491
  • 4
  • 34
  • 47

3 Answers3

3

Worth keeping any eye on this thread: https://groups.google.com/forum/#!topic/firebase-talk/MKfIzAtNNuA

GreenDome
  • 277
  • 2
  • 4
  • 15
3

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));
pwagner
  • 1,224
  • 1
  • 13
  • 31
2

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.

0x1ad2
  • 8,014
  • 9
  • 35
  • 48