Skip to content

Instantly share code, notes, and snippets.

@pankajmi
Created October 13, 2014 06:32
Show Gist options
  • Save pankajmi/14177978a41b23ebd296 to your computer and use it in GitHub Desktop.
Save pankajmi/14177978a41b23ebd296 to your computer and use it in GitHub Desktop.
(function(c,a){
window.mixpanel=a;
var b,d,h,e;b=c.createElement("script");
b.type="text/javascript";
b.async=!0;
b.src=("https:"===c.location.protocol?"https:":"http:")+
'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';
d=c.getElementsByTagName("script")[0];
d.parentNode.insertBefore(b,d);
a._i=[];
a.init=function(b,c,f){
function d(a,b){
var c=b.split(".");
2==c.length&&(a=a[c[0]],b=c[1]);
a[b]=function(){
a.push([b].concat(Array.prototype.slice.call(arguments,0)))
}
}
var g=a;
"undefined"!==typeof f?g=a[f]=[]:
f="mixpanel";
g.people=g.people||[];
h=['disable','track','track_pageview','track_links',
'track_forms','register','register_once','unregister','identify','alias','name_tag',
'set_config','people.set','people.increment','people.track_charge','people.append'];
for(e=0;e<h.length;e++)
d(g,h[e]);
a._i.push([b,c,f])
};
a.__SV=1.2;
})(document,window.mixpanel||[]);
mixpanel.init(<mixpanelToken>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment