0.0.2 • Published 5 years ago

angular-module-for-google-analytics v0.0.2

Weekly downloads
5
License
MIT
Repository
-
Last release
5 years ago

Angular Module for Google Analytics

Easily add Google Analytics tracking to your Angular based project.

Getting started:

npm i angular-module-for-google-analytics

Then in your app.module.ts:

@NgModule({
    imports: [
        AnalyticsModule,
    ]
})
export class AppModule {}

And in your main component (usually app.component.ts):

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

    constructor(
        private analytics: AnalyticsService,
    ) {

    }

    ngOnInit() {
        this.analytics.init("UA-123456");
    }
}