@@ -8,15 +8,15 @@ Amplitude-Javascript
882 . On every page that uses analytics, paste the following Javascript code between the ` <head> ` and ` </head> ` tags:
99
1010 <script type="text/javascript">
11- (function(t,e ){var n=t .amplitude||{};var i=e .createElement("script");i .type="text/javascript";
12- i .async=true;i .src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.4.1-min.gz.js";
13- var s=e .getElementsByTagName("script")[0];s .parentNode.insertBefore(i,s);n.Identify=function(){
14- this.p={a:{},s:{},u:{},so:{}}} ;n.Identify.prototype.add =function(t,e ){this.p.a[t]=e ;
15- return this};n.Identify.prototype.set= function(t, e){this.p.s[t]=e;return this};n.Identify.prototype.setOnce= function(t,e ){
16- this.p.so[t]=e;return this}; n.Identify.prototype.unset =function(t ){this.p.u [t]= "-";
17- return this} ;n._q=[];function r(t ){n[t ]=function(){n._q.push([t ].concat(Array.prototype.slice.call(arguments,0)));
18- }}var o =["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify"];
19- for(var p =0;p<o .length;p ++){r(o[p ])}t .amplitude=n})(window,document);
11+ (function(e,t ){var n=e .amplitude||{};var s=t .createElement("script");s .type="text/javascript";
12+ s .async=true;s .src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.4.1-min.gz.js";
13+ var i=t .getElementsByTagName("script")[0];i .parentNode.insertBefore(s,i);var r={add:["a",false],
14+ set:["s",false],setOnce:["so",false],unset:["u",true]} ;n.Identify=function(){this.p={} ;
15+ Object.keys(r).forEach( function(e){this.p[r[e][0]]={}}.bind( this))}; function a(e,t,s ){
16+ n.Identify.prototype[e] =function(e,n ){this.p[t][e]=s? "-":n;return this}}Object.keys(r).forEach(function(e){
17+ a(e,r[e][0],r[e][1])}) ;n._q=[];function o(e ){n[e ]=function(){n._q.push([e ].concat(Array.prototype.slice.call(arguments,0)));
18+ }}var c =["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify"];
19+ for(var u =0;u<c .length;u ++){o(c[u ])}e .amplitude=n})(window,document);
2020
2121 amplitude.init("YOUR_API_KEY_HERE");
2222 </script>
0 commit comments