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) {
$rootScope.$on('$stateChangeError',
function (event, toState, toParams, fromState, fromParams, error) {
trackEvent('$stateChangeError', error && (error.debug || error.message || error));
});
$rootScope.$on('$stateChangeSuccess',
function (event, toState, toParams, fromState, fromParams) {
trackEvent('$stateChangeSuccess', toState);
});
});
Regarding the directive, I think you can read all about it in the documentation.
1 Like
thanks its work fine
Okay that’s cool …