diff --git a/package-lock.json b/package-lock.json index 7ed491a..7d04c24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3409,6 +3409,14 @@ } } }, + "angulartics2": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/angulartics2/-/angulartics2-8.1.0.tgz", + "integrity": "sha512-DJWnpKfOUEtaQsWTCcyuzgWCQM6mAYHReqpgmt3IXo1/joofGhDZu/RPV48RVm2voJFoKL4Lp5JNac9vV+NJsg==", + "requires": { + "tslib": "^1.9.0" + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", diff --git a/package.json b/package.json index 8fcd9ab..6718f8c 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@nguniversal/express-engine": "^8.1.1", "@nguniversal/module-map-ngfactory-loader": "8.1.1", "angular-cli-ghpages": "^0.6.0", + "angulartics2": "^8.1.0", "express": "^4.15.2", "hammerjs": "^2.0.8", "ngx-markdown": "^8.2.1", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7b70665..2ae10fa 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,6 @@ import {Component} from '@angular/core'; import {Country} from '@angular-material-extensions/select-country'; +import {Angulartics2GoogleAnalytics} from 'angulartics2/ga'; @Component({ selector: 'app-root', @@ -9,6 +10,10 @@ import {Country} from '@angular-material-extensions/select-country'; export class AppComponent { title = 'select-county'; + constructor(angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics) { + angulartics2GoogleAnalytics.startTracking(); + } + onCountrySelected($event: Country) { console.log($event); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 155e422..6dc8530 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,6 +8,7 @@ import {HttpClientModule} from '@angular/common/http'; import {MarkdownModule} from 'ngx-markdown'; import {FlexLayoutModule} from '@angular/flex-layout'; import {BrowserModule} from '@angular/platform-browser'; +import { Angulartics2Module } from 'angulartics2'; @NgModule({ declarations: [ @@ -19,6 +20,7 @@ import {BrowserModule} from '@angular/platform-browser'; HttpClientModule, AppRoutingModule, FlexLayoutModule, + Angulartics2Module.forRoot(), MarkdownModule.forRoot(), MatSelectCountryModule, ], diff --git a/src/index.html b/src/index.html index da6b126..956af8e 100644 --- a/src/index.html +++ b/src/index.html @@ -1,13 +1,55 @@
-