Closed gaurav150493 closed 6 years ago
I am using your module it is tracking the page views but it is not tracking my events. I have included angularytics.min.js in my page and this is the other code i have used.
app.js
.config(function($stateProvider, $urlRouterProvider, AngularyticsProvider){ AngularyticsProvider.setEventHandlers(['Console', 'GoogleUniversal']); $urlRouterProvider.otherwise('/'); $stateProvider .state('upload', { url: "/:user_id", templateUrl: 'templates/upload.html', controller: 'uploadCtrl' }) });
controller
.controller('uploadCtrl', function(Angularytics, $scope){ $scope.trackDownload = function(){ Angularytics.trackEvent("Home Category", "Button clicked"); console.log('tracked'); } });
html <a href="#" ng-click="trackDownload()">Click Me!</a>
<a href="#" ng-click="trackDownload()">Click Me!</a>
Looks like you have missed the init method to invoke within run method.
.run(function (Angularytics) { Angularytics.init(); });
I am using your module it is tracking the page views but it is not tracking my events. I have included angularytics.min.js in my page and this is the other code i have used.
app.js
controller
html
<a href="#" ng-click="trackDownload()">Click Me!</a>