import { Injectable } from '@angular/core' ; import { Firebase } from '@ionic-native/firebase' ; @ Injectable ( ) export class LogService { constructor ( protected firebase ) { } logUserView ( ) { this . firebase . logEvent ( 'c_user_view_' + new Date ( ) . getHours ( ) , { } ) ; } logPageView ( page ) { this . firebase . logEvent ( 'c_page_view' , { page } ) ; } logClick ( page , name ) { this . firebase . logEvent ( 'c_click' , { page , name } ) ; } logWebsite ( page , url , refName ) { this . firebase . logEvent ( 'c_website' , { page , name , ref : refName } ) ; } logEvent ( page , name , data ? ) { if ( data == null ) { this . firebase . logEvent ( 'c_' + name , { page , name } ) ; } else { this . firebase . logEvent ( 'c_' + name , { page , name , data } ) ; } } }