@ngx-tiny/gtag
v10.0.0
Published
   ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { }Add the component to your
app.component.htmlto load the scripts and start logging page views<ngx-gtag></ngx-gtag>
Event:
import { Component, OnInit } from '@angular/core';
import { GtagEventService } from '@ngx-tiny/gtag';
@Component({
selector: 'app-landing',
templateUrl: './landing.component.html',
styleUrls: ['./landing.component.sass']
})
export class LandingComponent implements OnInit {
constructor(
private gtagEventService: GtagEventService
) { }
ngOnInit() {
this.gtagEventService.event({
action: "landing",
options: { event_category: "landing loaded" }
});
}
}
Support
Support me by becoming a patron and buying me a beer :)
License
See the LICENSE file.
