mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
fix(analytics): analytics.service check whether ga function exists #5529
This commit is contained in:
parent
7ad3fff370
commit
dd138335f7
1 changed files with 6 additions and 1 deletions
|
|
@ -10,7 +10,12 @@ export class AnalyticsService {
|
||||||
private enabled: boolean;
|
private enabled: boolean;
|
||||||
|
|
||||||
constructor(private location: Location, private router: Router) {
|
constructor(private location: Location, private router: Router) {
|
||||||
this.enabled = false;
|
this.enabled = true;
|
||||||
|
this.handleGaAvailability();
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleGaAvailability() {
|
||||||
|
this.enabled = (typeof ga === 'function');
|
||||||
}
|
}
|
||||||
|
|
||||||
trackPageViews() {
|
trackPageViews() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue