Your code is missing the second argument:
(function() {
MyApp.eventTrack = function(firstArg, secondArg) {
mixpanel.track(firstArg, secondArg);
}
}());
Alternatively, you can handle an unbounded number of arguments by using apply
and arguments
together:
MyApp.eventTrack = function() {
mixpanel.track.apply(mixpanel, arguments);
}
This calls mixpanel.track
with all arguments passed to MyApp.eventTrack
.