UNPKG

ngx-matomo

Version:

Matomo (aka. Piwik) web analytics for Angular applications.

51 lines (50 loc) 1.72 kB
import { OnDestroy } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { MatomoConfiguration } from './matomo-configuration'; import { MatomoTracker } from './matomo-tracker.service'; import * as i0 from "@angular/core"; /** * Service for tracking route changes. * * @export */ export declare class MatomoRouteTracker implements OnDestroy { private readonly configuration; private readonly matomoTracker; private readonly router; private readonly activatedRoute; /** * Previous route url of matomo route tracker. */ private previousPageUrl?; /** * Subscription for managing route events. */ private subscription?; /** * Creates an instance of MatomoRouteTracker. * * @param configuration Matomo configuration provided by DI. * @param matomoTracker Instance of MatomoTracker provided by DI. * @param router Instance of Router provided by DI. * @param activatedRoute Instance of ActivatedRoute provided by DI. */ constructor(configuration: MatomoConfiguration, matomoTracker: MatomoTracker, router: Router, activatedRoute: ActivatedRoute); /** * Starts tracking route changes. * Matomo DocumentTitle will be set with `data.matomoTitle` of your routes. * * This service shall not be used directly within an application. */ startTracking(): void; /** * Stops tracking route changes. */ stopTracking(): void; /** * Angular OnDestroy lifecycle hook. */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<MatomoRouteTracker, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MatomoRouteTracker>; }