Add mixpanel events to the tutorial.
This commit is contained in:
parent
fe6b766ff1
commit
41a173ae85
2 changed files with 23 additions and 6 deletions
|
@ -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()) {
|
||||
|
|
Reference in a new issue