import { ComponentRef, Provider } from '@angular/core'; import { IGoogleAnalyticsRoutingSettings } from '../interfaces/i-google-analytics-routing-settings'; import { GoogleAnalyticsService } from '../services/google-analytics.service'; /** * Provide a DI Configuration to attach GA Trigger to Router Events at Angular Startup Cycle. */ export declare const NGX_GOOGLE_ANALYTICS_ROUTER_INITIALIZER_PROVIDER: Provider; /** * Attach a listener to `NavigationEnd` Router event. So, every time Router finish the page resolution it should call `NavigationEnd` event. * We assume that NavigationEnd is the final page resolution and call GA `page_view` command. * * To avoid double binds, we also destroy the subscription when de Bootstrap Component is destroyed. But, we don't know for sure * that this strategy does not cause double bind on multiple bootstrap components. * * We are using the component's injector reference to resolve Router, so I hope there is no problem with double binding. * * If you have this problem, I encourage not Use NgxGoogleAnalyticsRouterModule and attach the listener on AppComponent initialization. */ export declare function GoogleAnalyticsRouterInitializer(settings: IGoogleAnalyticsRoutingSettings, gaService: GoogleAnalyticsService): (c: ComponentRef) => void;