// Mixpanel Cheatsheet // This requires the mixpanel javascript library to be embedded on your site // https://mixpanel.com/help/reference/javascript-full-api-reference mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a new instance of the Mixpanel tracking object mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet). Good example is Optimizely. mixpanel.disable('eventToDisable'); // Disable events on the Mixpanel object. If passed no arguments, this function disables tracking of any event. If passed an array of event names, those events will be disabled, but other events will continue to be tracked. mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21}, callback); // Track an event. mixpanel.track_links('#nav', 'Clicked Nav Link', {'Gender': 'Male', 'Age': 21}); // Track clicks on a set of document elements. mixpanel.track_forms('#register', 'Created Account', {'Gender': 'Male', 'Age': 21}); // Tracks form submissions.