$ npm i --save ng-pendo
Import pendolytics module:
import ngPendo from 'ng-pendo';
or
var ngPendo = require('ng-pendo');
Provide your api key:
window.pendo_options = {
apiKey: 'replace this with your api key',
usePendoAgentAPI: true
};
Include pendolytics
in your AngularJS modules:
angular.module('your-app', [...,'pendolytics',...]);
or
angular.module('your-app', [...,ngPendo,...]);
When you have access to the visitor information use it to identify the visitor:
getVisitorInformationFromSomewhere().then(function (visitor) {
$pendolytics.identify({
visitor: {
id: visitor.id,
role: visitor.role,
email: visitor.email
},
account: {
id: visitor.accountId
}
});
});