ngx-bmx-footprint is an Angular library which is used as a plugin to integrate bloomsight.io with Angular applications.
import { NgxBmxFootprintModule } from 'ngx-bmx-footprint';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,
NgxBmxFootprintModule.forRoot({
propertyToken: 'your-property-token',
developmentMode: true //log output or not,
stopService: true // will stop website tracking
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
This start tracking website visits for your angular application.
import {FootprintService} from 'ngx-bmx-footprint';
constructor(public footprintService: FootprintEventService) {}
<button (click)="onClick()">Click</button>
import {FootprintEventService} from 'ngx-bmx-footprint';
constructor(public footprintService: FootprintEventService) {}
public onClick() {
// track event
this.footprintService.triggerEvent('your-event-token');
// track event with properties
// here the key is the name of the metadata that you mention during property creation
this.footprintService.triggerEvent('your-event-token', {
'key': 'data'
});
}
<button (click)="onClick()">Click</button>
import {FootprintEventService} from 'ngx-bmx-footprint';
constructor(public footprintService: FootprintEventService) {}
public onClick() {
this.footprintService.sendMail(
'engineId',
'userId',
'templateId',
metadata // form data for your email
);
}