import { InjectionToken } from '@angular/core'; /** Injection token for {@link MatomoConfiguration} */ export declare const MATOMO_CONFIGURATION: InjectionToken; /** * For internal use only. Injection token for {@link InternalMatomoConfiguration} * */ export declare const INTERNAL_MATOMO_CONFIGURATION: InjectionToken; /** * For internal use only. Module configuration merged with default values. * */ export declare type InternalMatomoConfiguration = MatomoConfiguration & Required; export declare enum MatomoInitializationMode { /** Automatically inject matomo script using provided configuration */ AUTO = 0, /** Do not inject Matomo script. In this case, initialization script must be provided */ MANUAL = 1, /** * Automatically inject matomo script when deferred tracker configuration is provided using `MatomoDeferredInitializerService.init`. */ AUTO_DEFERRED = 2 } export declare enum MatomoConsentMode { /** Do not require any consent, always track users */ NONE = 0, /** Require cookie consent */ COOKIE = 1, /** Require tracking consent */ TRACKING = 2 } export interface MatomoTrackerConfiguration { /** Matomo site id */ siteId: number | string; /** Matomo server url */ trackerUrl: string; /** The trackerUrlSuffix is always appended to the trackerUrl. It defaults to matomo.php */ trackerUrlSuffix?: string; } export interface MultiTrackersConfiguration { /** * Configure multiple tracking servers. Order matters: if no custom script url is * provided, Matomo script will be downloaded from first tracker. */ trackers: MatomoTrackerConfiguration[]; } export interface BaseMatomoConfiguration { /** Set to `true` to disable tracking */ disabled?: boolean; /** If `true`, track a page view when app loads (default `false`) */ trackAppInitialLoad?: boolean; /** * Set to `false` to disable this Matomo feature (default `true`). * Used when {@link trackAppInitialLoad} is `true` and by Router module. */ enableLinkTracking?: boolean; /** Set to `true` to not track users who opt out of tracking using Do Not Track setting */ acceptDoNotTrack?: boolean; /** * Configure user consent requirement * * To identify whether you need to ask for any consent, you need to determine whether your lawful * basis for processing personal data is "Consent" or "Legitimate interest", or whether you can * avoid collecting personal data altogether. * * Matomo differentiates between cookie and tracking consent: * - In the context of tracking consent no cookies will be used and no tracking request * will be sent unless consent was given. As soon as consent was given, tracking requests will * be sent and cookies will be used. * - In the context of cookie consent tracking requests will always be sent. However, * cookies will be only used if consent for storing and using cookies was given by the user. * * Note that cookies impact reports accuracy. * * See Matomo guide: {@link https://developer.matomo.org/guides/tracking-consent} */ requireConsent?: MatomoConsentMode; /** Set to `true` to enable Javascript errors tracking as events (with category JavaScript Errors) */ enableJSErrorTracking?: boolean; /** Set to `true` to run matomo calls outside of angular NgZone. This may fix angular freezes. */ runOutsideAngularZone?: boolean; } export interface BaseAutoMatomoConfiguration { /** * Set the script initialization mode (default is `AUTO`) * */ mode?: M; /** Matomo script url (default is `matomo.js` appended to main tracker url) */ scriptUrl: string; } declare type Without = { [P in Exclude]?: never; }; declare type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; declare type XOR3 = XOR>; export declare type ManualMatomoConfiguration = { /** * Set the script initialization mode (default is `AUTO`) * */ mode: MatomoInitializationMode.MANUAL; }; export declare type DeferredMatomoConfiguration = { /** * Set the script initialization mode (default is `AUTO`) * */ mode: MatomoInitializationMode.AUTO_DEFERRED; }; export declare type ExplicitAutoConfiguration = Partial> & XOR; export declare type EmbeddedAutoConfiguration = BaseAutoMatomoConfiguration & Partial; export declare type AutoMatomoConfiguration = XOR, EmbeddedAutoConfiguration>; export declare type MatomoConfiguration = BaseMatomoConfiguration & XOR3; export declare function isAutoConfigurationMode(config: MatomoConfiguration): config is AutoMatomoConfiguration; export declare function isEmbeddedTrackerConfiguration(config: AutoMatomoConfiguration): config is EmbeddedAutoConfiguration; export declare function isExplicitTrackerConfiguration(config: AutoMatomoConfiguration): config is ExplicitAutoConfiguration; export declare function isMultiTrackerConfiguration(config: AutoMatomoConfiguration): config is MultiTrackersConfiguration; export declare function getTrackersConfiguration(config: ExplicitAutoConfiguration): MatomoTrackerConfiguration[]; export {};