analytics disabled by default on mas
This commit is contained in:
parent
783a86fe58
commit
902d72457c
|
@ -8,7 +8,7 @@ const GaObj = 'ga';
|
||||||
|
|
||||||
export class Analytics {
|
export class Analytics {
|
||||||
private gaTrackingId: string = null;
|
private gaTrackingId: string = null;
|
||||||
private isFirefox = false;
|
private defaultDisabled = false;
|
||||||
private appVersion: string;
|
private appVersion: string;
|
||||||
|
|
||||||
constructor(win: Window, private gaFilter?: () => boolean,
|
constructor(win: Window, private gaFilter?: () => boolean,
|
||||||
|
@ -28,7 +28,7 @@ export class Analytics {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.appVersion = this.platformUtilsService.getApplicationVersion();
|
this.appVersion = this.platformUtilsService.getApplicationVersion();
|
||||||
this.isFirefox = this.platformUtilsService.isFirefox();
|
this.defaultDisabled = this.platformUtilsService.isFirefox() || this.platformUtilsService.isMacAppStore();
|
||||||
this.gaTrackingId = this.platformUtilsService.analyticsId();
|
this.gaTrackingId = this.platformUtilsService.analyticsId();
|
||||||
|
|
||||||
(win as any).GoogleAnalyticsObject = GaObj;
|
(win as any).GoogleAnalyticsObject = GaObj;
|
||||||
|
@ -43,8 +43,7 @@ export class Analytics {
|
||||||
}
|
}
|
||||||
|
|
||||||
const disabled = await this.storageService.get<boolean>(ConstantsService.disableGaKey);
|
const disabled = await this.storageService.get<boolean>(ConstantsService.disableGaKey);
|
||||||
// Default for Firefox is disabled.
|
if ((this.defaultDisabled && disabled == null) || disabled != null && disabled) {
|
||||||
if ((this.isFirefox && disabled == null) || disabled != null && disabled) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue