Skip to content

Instantly share code, notes, and snippets.

@edwardhotchkiss
Created March 10, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardhotchkiss/2012162 to your computer and use it in GitHub Desktop.
Save edwardhotchkiss/2012162 to your computer and use it in GitHub Desktop.
Jekyll and MixPanel
/**
* Create Jekyll Object, with mpq wrapper
*/
var jekyll = Object.create({
mpq : {
track : function(eventName, properties, callback) {
properties = properties || {};
callback = callback || function(){};
if (!/localhost/.test(document.location.hostname)) {
mpq.track(eventName, properties, callback);
};
}
}
});
/**
* Track Event "Post Some-Post"
*/
jekyll.mpq.track('EventName', { some : 'data' });
/* EOF*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment