license import { Injectable , Inject } from '@angular/core' ; import { NB_WINDOW } from '@nebular/theme' ; @ Injectable ( ) export class EvaAnalytics { private enabled : boolean ; constructor ( @ Inject ( NB_WINDOW ) private window ) { this . enabled = this . window . location . href . indexOf ( 'akveo.github.io' ) >= 0 ; } trackEvent ( eventName , eventVal = '' ) { if ( this . enabled ) { this . gtmPushToDataLayer ( { event : eventName , eventValue : eventVal } ) ; } } private gtmPushToDataLayer ( params ) { this . window . dataLayer . push ( params ) ; } }