mirror of
https://github.com/akveo/eva-icons.git
synced 2025-02-21 08:12:27 +01:00
fix(analytics): update analytics service (#37)
* fix(analytics): update analytics service * fix(analytics): update analytics service, remove ga detection
This commit is contained in:
parent
9298aa76ad
commit
5d18d124f5
@ -27,6 +27,6 @@ export class HeaderComponent {
|
||||
clickOnDownloadPack() {
|
||||
const version = this.versionService.getEvoVersion();
|
||||
|
||||
this.analytics.trackEvent('download-pack', `download pack version: ${version}`);
|
||||
this.analytics.trackEvent('downloadPack', `download pack version: ${version}`);
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,6 @@ export class DownloadIconComponent implements AfterViewInit {
|
||||
}
|
||||
|
||||
clickOnDownloadIcon(icon: { format: string; title: string }) {
|
||||
this.analytics.trackEvent('download-icon', `${this.selectedIcon}.${icon.format}`);
|
||||
this.analytics.trackEvent('downloadIcon', `${this.selectedIcon}.${icon.format}`);
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ export class PageContainerComponent implements AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
clickIcon(icon) {
|
||||
this.analytics.trackEvent('open-icon-dialog', icon);
|
||||
this.analytics.trackEvent('openIconDialog', icon);
|
||||
|
||||
if (this.isMobileMode) {
|
||||
return;
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { NB_WINDOW } from '@nebular/theme';
|
||||
declare const ga: any;
|
||||
|
||||
@Injectable()
|
||||
export class EvaAnalytics {
|
||||
@ -18,7 +17,12 @@ export class EvaAnalytics {
|
||||
|
||||
trackEvent(eventName: string, eventVal: string = '') {
|
||||
if (this.enabled) {
|
||||
ga('send', 'event', eventName, eventVal);
|
||||
this.gtmPushToDataLayer({ event: eventName, eventValue: eventVal });
|
||||
}
|
||||
}
|
||||
|
||||
// Push to 'dataLayer' Google Tag Manager array
|
||||
private gtmPushToDataLayer(params) {
|
||||
this.window.dataLayer.push(params);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<script>
|
||||
dataLayer = [];
|
||||
</script>
|
||||
<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
|
Loading…
x
Reference in New Issue
Block a user