Add mixpanel events to the tutorial.

This commit is contained in:
jakedt 2014-02-13 17:27:50 -05:00
parent fe6b766ff1
commit 41a173ae85
2 changed files with 23 additions and 6 deletions

View file

@ -134,6 +134,15 @@ angular.module("angular-tour", [])
});
};
var fireMixpanelEvent = function() {
if (!$scope.step || !mixpanel) { return; }
var eventName = $scope.step['mixpanelEvent'];
if (eventName) {
mixpanel.track(eventName);
}
};
$scope.setStepIndex = function(stepIndex) {
// Close existing spotlight and signal timer.
teardownSignal();
@ -149,6 +158,8 @@ angular.module("angular-tour", [])
$scope.step = $scope.tour.steps[stepIndex];
fireMixpanelEvent();
// If the signal is already true, then skip this step entirely.
setupSignal();
if (checkSignal()) {