Is Analytics Enabled

const IS_ANALYTICS_ENABLED

This token is injected into the Analytics Service to set analytics on or off.

Its value is derived from isDevMode. It is overridden in the Analytics Service's tests to prevent analytics during testing.

is-analytics-enabled.token.ts
export const IS_ANALYTICS_ENABLED: InjectionToken<boolean> =
  new InjectionToken<boolean>('IS_ANALYTICS_ENABLED', {
    factory: (): boolean => !isDevMode(),
    providedIn: 'root',
  });

Last updated