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
This commit is contained in:
parent
7ad3fff370
commit
24362b91d6
1 changed files with 6 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue