Tracking Events and Pageviews with Segment.io (http://segment.io)
Follow these steps:
- Add the service to your angular js app module:
var app = angular.module('myapp', ['segmentio']) {
...
});
- Now just have analytics to be injected in your controller.
function myCtrl($rootScope, $scope, $http, segmentio) {
...
};
- Call any method documented here: https://segment.io/libraries/analytics.js
Via Twitter Bower (http://bower.io/)
Run bower install angular-segmentio
in a terminal
-
Install dependencies via npm:
npm install
(in the project folder) -
Run grunt:
grunt
orgrunt uglify
-
The build result is in the build directory