ionic-cordova-gulp-seed
Version:
Ionic & Cordova & Gulp seed with organized code, tests, bower support and some other stuff. Originated from ionic-angular-cordova-seed.
68 lines (57 loc) • 2.12 kB
JavaScript
/**
* @license Angulartics v0.17.2
* (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics
* Contributed by http://github.com/L42y
* License: MIT
*/
(function(angular) {
;
/**
* @ngdoc overview
* @name angulartics.mixpanel
* Enables analytics support for Mixpanel (http://mixpanel.com)
*/
angular.module('angulartics.mixpanel', ['angulartics'])
.config(['$analyticsProvider', function ($analyticsProvider) {
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetUsername(function (userId) {
mixpanel.identify(userId);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetAlias(function (userId) {
mixpanel.alias(userId);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetSuperPropertiesOnce(function (properties) {
mixpanel.register_once(properties);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetSuperProperties(function (properties) {
mixpanel.register(properties);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetUserPropertiesOnce(function (properties) {
mixpanel.people.set_once(properties);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerSetUserProperties(function (properties) {
mixpanel.people.set(properties);
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerPageTrack(function (path) {
mixpanel.track( "Page Viewed", { "page": path } );
});
});
angulartics.waitForVendorApi('mixpanel', 500, '__loaded', function (mixpanel) {
$analyticsProvider.registerEventTrack(function (action, properties) {
mixpanel.track(action, properties);
});
});
}]);
})(angular);