I have tried different work around, but I am unable to do Firebase analytics in ionic 3. Please anyone help me from scratch on Firebase analytics from ionic 3.
Asked
Active
Viewed 527 times
0
-
What SDK/library are you using to use Firebase in Ionic. If you're using the raw JavaScript SDK, you won't be able to use Firebase Analytics, as there is no support for it in that SDK. See https://stackoverflow.com/questions/37325871/firebase-analytics-for-web-apps-after-firebase-expansion – Frank van Puffelen Feb 07 '19 at 03:24
2 Answers
0
first add the firebase analytics to your project:
ionic cordova plugin add cordova-plugin-firebase-analytics
npm install @ionic-native/firebase-analytics
then create the event you want to log:
import { FirebaseAnalytics } from '@ionic-native/firebase-analytics';
constructor(private firebaseAnalytics: FirebaseAnalytics){
this.firebaseAnalytics.logEvent('custom_event',{param: 'my_param'
}
and finally add the custom_event and the param to your analytics dashboard to see it (it takes few hours for it to appear)

Leonid Prokopenko
- 49
- 8