ngx-bmx-footprint
TypeScript icon, indicating that this package has built-in type declarations

0.0.41 • Public • Published

ngx-bmx-footprint

ngx-bmx-footprint is an Angular library which is used as a plugin to integrate bloomsight.io with Angular applications.

Import in app.module.ts

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 { }

Import in app.component.ts

This start tracking website visits for your angular application.

import {FootprintService} from 'ngx-bmx-footprint';

constructor(public footprintService: FootprintEventService) {}

Track a specific event such as click

In app.component.html

 <button (click)="onClick()">Click</button>

In app.component.ts

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' 
    });

}

Send email

In component.html

 <button (click)="onClick()">Click</button>

In component.ts

import {FootprintEventService} from 'ngx-bmx-footprint';

constructor(public footprintService: FootprintEventService) {}

public onClick() {
    
    this.footprintService.sendMail(
        'engineId',
        'userId',
        'templateId',
        metadata // form data for your email
    );

}

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-bmx-footprint

Weekly Downloads

2

Version

0.0.41

License

none

Unpacked Size

354 kB

Total Files

52

Last publish

Collaborators

  • deepdey20998