An easy implementation pendo on angular6+ apps.
npm install ngx-pendo
https://github.com/yociduo/ngx-pendo/issues
import { NgxPendoModule } from 'ngx-pendo';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgxPendoModule.forRoot({
pendoApiKey: 'pendo-api-key',
pendoIdFormatter: (value: any) => value.toString().toLowerCase()
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
import { Component, OnInit } from '@angular/core';
import { NgxPendoService } from 'ngx-pendo';
@Component( ... )
export class AppComponent implements OnInit {
constructor(protected ngxPendoService: NgxPendoService) {
}
ngOnInit() {
this.ngxPendoService.initialize({
id: 'PUT_VISITOR_ID_HERE',
name: 'Neo',
email: '[email protected]',
role: 'godlike'
}, {
id: 'PUT_ACCOUNT_ID_HERE',
name: 'CorpSchmorp'
});
}
}
You can use angular directives to add pendo id.
<div ngx-pendo-section="section">
<button ngx-pendo-id="click_test">Click Test</button>
</div>