Sammy-mixpanel is a project mainly written in JavaScript, it's free.
A Sammy.js plugin for tracking route changes in Mixpanel
A small plugin that enables Mixpanel tracking for your Sammy powered App. Following the footsteps of the great Sammy Google Analytics Plugin.
Download sammy.mixpanel.js and install it in your public javascripts directory. Include it in your document AFTER Sammy.
Install Mixpanel to your site as you normally would. Modify the Mixpanel script:
... d=["init","track","track_links","track_forms","track_pageview","register","register_once","identify","name_tag","set_config"]; ...
^ add this!
Then, simply add the plugin to your Sammy App and it will automatically track all of your routes in Mixpanel. They will appear as page views to the route's path.
$.sammy(function() { with(this) {
use(Sammy.Mixpanel)
...
}});
If you have routes that you do not want to track, simply call "noTrack" within the route.
$.sammy(function() { with(this) {
use(Sammy.Mixpanel)
get('#/dont/track/me', function() {
this.noTrack(); // This route will not be tracked
});
}});
http://hleinone.github.com/sammy-mixpanel
Sammy
Sammy requires jQuery >= 1.3.2
Sammy is covered by the MIT License. See LICENSE for more information.
Sammy includes code originally created by John Resig (Class implementation) and Greg Borenstien (srender).