forked from amplitude/Amplitude-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 2
/
amplitude-segment-snippet.min.js
16 lines (16 loc) · 1.17 KB
/
amplitude-segment-snippet.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};function r(e,t){
e.prototype[t]=function(){
this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}
var i=function(){this._q=[];return this}
;var s=["add","append","clearAll","prepend","set","setOnce","unset"]
;for(var o=0;o<s.length;o++){r(i,s[o])}n.Identify=i;var a=function(){this._q=[]
;return this}
;var u=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
;for(var c=0;c<u.length;c++){r(a,u[c])}n.Revenue=a
;var p=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
;function l(e){function t(t){e[t]=function(){
e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}
for(var n=0;n<p.length;n++){t(p[n])}}l(n);n.getInstance=function(e){
e=(!e||e.length===0?"$default_instance":e).toLowerCase()
;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};l(n._iq[e])}return n._iq[e]}
;e.amplitude=n})(window,document);