LeanEngage integration for your AngularJS app
bower install angular-leanengage
Make sure you include the module in your application config
angular.module('myApp', [
'leanEngage',
...
]);
angular.module('myApp').config(function(LeanEngageProvider) {
LeanEngageProvider.setAppId('XXXX');
})
After authentication, start tracking your customer:
LeanEngage.start({
user_id: user.id,
name: user.username,
email: user.email,
custom_data: {
subscription: user.subscription
}
});
angular.module('myApp').controller('MyController', function (LeanEngage) {
LeanEngage.trackEvent('products', 'view');
});