Ionic Analysis error


i am using ionic analysis in my project .but it will not analysis each state.
how will i get each state($stateparam) module analysis in my project and also need clarify about ionic auto analysis directive.


I do it like this, works fine for me:

var trackEvent = function (name, event) {
  try {
    $ionicAnalytics.track(name, {event: event});
  } catch (e) {
    $log.error("error tracking " + name + ":" + e);

angular.module('app').run(function ($ionicPlatform, $state, $rootScope) {

    function (event, toState, toParams, fromState, fromParams, error) {

      trackEvent('$stateChangeError', error && (error.debug || error.message || error));


    function (event, toState, toParams, fromState, fromParams) {

      trackEvent('$stateChangeSuccess', toState);

Regarding the directive, I think you can read all about it in the documentation.


thanks its work fine


Okay that’s cool …