import { AnalyticsFirebase } from '@ionic-native/analytics-firebase';
constructor(private analyticsFirebase: AnalyticsFirebase) { }
const eventParams = {};
eventParams[this.analyticsFirebase.DEFAULT_PARAMS.LEVEL] = 29;
this.analyticsFirebase.logEvent(this.analyticsFirebase.DEFAULT_EVENTS.LEVEL_UP, eventParams)
.then(() => console.log('Event successfully tracked'))
.catch(err => console.log('Error tracking event:', err));
const eventParams = {};
eventParams['my-prop'] = 29;
this.analyticsFirebase.logEvent('my-event', eventParams)
.then(() => console.log('Event successfully tracked'))
.catch(err => console.log('Error tracking event:', err));
this.analyticsFirebase.resetAnalyticsData()
.then(() => console.log('Analytics data have been reset'))
.catch(err => console.log('Error resetting analytics data:', err));
this.analyticsFirebase.setCurrentScreen('Home')
.then(() => console.log('View successfully tracked'))
.catch(err => console.log('Error tracking view:', err));
this.analyticsFirebase.setUserId('USER-ID')
.then(() => console.log('User id successfully set'))
.catch(err => console.log('Error setting user id:', err));
this.analyticsFirebase.setUserProperty('KEY', 'VALUE')
.then(() => console.log('User property successfully set'))
.catch(err => console.log('Error setting user property:', err));