mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-22 02:10:12 +01:00
feat(demo): add landing page with docs (#1951)
This commit is contained in:
parent
67c9587b87
commit
43cc3a1556
190 changed files with 15425 additions and 21 deletions
28
docs/app/@theme/services/analytics.service.ts
Normal file
28
docs/app/@theme/services/analytics.service.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Akveo. All Rights Reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*/
|
||||
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { NB_WINDOW } from '@nebular/theme';
|
||||
|
||||
@Injectable()
|
||||
export class NgxAnalytics {
|
||||
private enabled: boolean;
|
||||
|
||||
constructor(@Inject(NB_WINDOW) private window) {
|
||||
this.enabled = this.window.location.href.indexOf('akveo.github.io') >= 0;
|
||||
}
|
||||
|
||||
trackEvent(eventName: string, eventVal: string = '') {
|
||||
if (this.enabled) {
|
||||
this.gtmPushToDataLayer({ event: eventName, eventValue: eventVal });
|
||||
}
|
||||
}
|
||||
|
||||
// Push to 'dataLayer' Google Tag Manager array
|
||||
private gtmPushToDataLayer(params) {
|
||||
this.window.dataLayer.push(params);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue