fix(analytics): analytics.service check whether ga function exists

This commit is contained in:
wurmloch 2020-10-29 00:52:32 +01:00
parent 7ad3fff370
commit 24362b91d6

View file

@ -10,7 +10,12 @@ export class AnalyticsService {
private enabled: boolean;
constructor(private location: Location, private router: Router) {
this.enabled = false;
this.enabled = true;
this.handleGaAvailability();
}
private handleGaAvailability() {
this.enabled = (typeof ga === 'function');
}
trackPageViews() {