forked from mixpanel/mixpanel-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixpanel-jslib-snippet.min.js
3 lines (3 loc) · 1.72 KB
/
mixpanel-jslib-snippet.min.js
1
2
3
(function(f,a){if(!a.__SV){var e,g,i,h;window.mixpanel=a;a._i=[];a.init=function(e,f,c){function g(b,d){var a=d.split(".");2==a.length&&(b=b[a[0]],d=a[1]);b[d]=function(){b.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var b=a;"undefined"!==typeof c?b=a[c]=[]:c="mixpanel";b.people=b.people||[];b.toString=function(b){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);b||(d+=" (stub)");return d};b.people.toString=function(){return b.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
for(h=0;h<i.length;h++)g(b,i[h]);var j="set set_once union unset remove delete".split(" ");b.get_group=function(){function a(c){d[c]=function(){var a=[c].concat(Array.prototype.slice.call(arguments,0));b.push([e,a])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)a(j[c]);return d};a._i.push([e,f,c])};a.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:
"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);