diff --git a/sp.js b/sp.js index 68f0eee..2b7eb43 100644 --- a/sp.js +++ b/sp.js @@ -1,7 +1,7 @@ /*! * Snowplow - The world's most powerful web analytics platform * * @description JavaScript tracker for Snowplow - * @version 2.0.0-M4 + * @version 2.0.0 * @author Alex Dean, Simon Andersson, Anthon Pang, Fred Blundun * @copyright Anthon Pang, Snowplow Analytics Ltd * @license Simplified BSD @@ -38,7 +38,7 @@ var ad={top:"if (!objectTypes[typeof iterable]) return result;\n"+aA.top,array:f while(++aJ2?D(aJ,17,z(arguments,2),null,aI):D(aJ,1,null,null,aI)}function o(aN,aJ,aO){var aM=typeof aN;if(aN==null||aM=="function"){return aH(aN,aJ,aO)}if(aM!="object"){return ai(aN)}var aL=G(aN),aK=aL[0],aI=aN[aK];if(aL.length==1&&aI===aI&&!C(aI)){return function(aQ){var aP=aQ[aK];return aI===aP&&(aI!==0||(1/aI==1/aP))}}return function(aQ){var aR=aL.length,aP=false;while(aR--){if(!(aP=ar(aQ[aL[aR]],aN[aL[aR]],null,true))){break}}return aP}}function Q(aI){return aI}function an(){}function ai(aI){return function(aJ){return aJ[aI]}}A.bind=au;A.compact=B;A.createCallback=o;A.forIn=ac;A.forOwn=U;A.keys=G;A.map=x;A.property=ai;A.collect=x;A.identity=Q;A.isArguments=g;A.isArray=f;A.isDate=m;A.isEmpty=q;A.isFunction=aq;A.isNull=aG;A.isObject=C;A.isString=az;A.isUndefined=J;A.noop=an;A.VERSION="2.4.1";if(v&&K){if(aD){(K.exports=A)._=A}}}.call(this))}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{}) },{}],15:[function(b,c,a){(function(){var g=b("JSON"),h=b("./lib_managed/lodash"),f=b("./lib/detectors").localStorageAccessible(),d=typeof a!=="undefined"?a:this;d.OutQueueManager=function(q,l){var j=["snowplowOutQueue",q,l].join("_"),m=false,i,o;if(f){try{o=g.parse(localStorage.getItem(j))}catch(p){}}if(typeof o==="undefined"||o==null){o=[]}function r(t,s){o.push(t);i=s;if(f){localStorage.setItem(j,g.stringify(o))}if(!m){n()}}function n(){if(o.length<1){m=false;return}var t,u,s;m=true;for(s in o){if(o[s]&&o.hasOwnProperty(s)){t=o[s];if(!h.isString(i)){throw"No Snowplow collector configured, cannot track"}(function(v){var w=new Image(1,1);w.onload=function(){delete o[v];if(f){localStorage.setItem(j,g.stringify(o))}n()};w.onerror=function(){};w.src=i+t}(s))}}m=false;if(h.compact(o).length===0){o=[]}}return{enqueueRequest:r}}}())},{"./lib/detectors":11,"./lib_managed/lodash":14,JSON:1}],16:[function(b,c,a){(function(){var i=b("./lib_managed/lodash"),h=b("JSON"),d=b("./lib/base64"),g=typeof a!=="undefined"?a:this; function f(n){if(!n){return n}var m=d.base64encode(n);return m.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function j(n,m){return m?n/1:Math.floor(n/1000)}function l(m){return Math.floor(m/86400000)}g.isJson=function(m){return(!i.isUndefined(m)&&!i.isNull(m)&&(m.constructor==={}.constructor||m.constructor===[].constructor))};g.isNonEmptyJson=function(n){if(!g.isJson(n)){return false}for(var m in n){if(n.hasOwnProperty(m)){return true}}return false};g.payloadBuilder=function(n){var r="";var m=function(t,v,u){if(v!==undefined&&v!==null&&v!==""){var s=(r.length>0)?"&":"?";r+=s+t+"="+(u?encodeURIComponent(v):v)}};var q=function(s,t){m(s,t,true)};var o=function(s,t){m(s,t,false)};var p=function(s,t,u){if(g.isNonEmptyJson(u)){var v=h.stringify(u);if(n){o(s,f(v))}else{q(t,v)}}};return{add:q,addRaw:o,addJson:p,build:function(){return r}}}}())},{"./lib/base64":10,"./lib_managed/lodash":14,JSON:1}],17:[function(b,c,a){(function(){var h=b("./lib/helpers"),d=b("./in_queue"),g=b("./tracker"),f=typeof a!=="undefined"?a:this; -f.Snowplow=function(l,q){var j=document,m=window,o="js-2.0.0-M4",n={expireDateTime:null,hasLoaded:false,registeredOnLoadHandlers:[]};function p(){var s;if(n.expireDateTime){do{s=new Date()}while(s.getTime()=0){ba=ba.slice(0,a9)}if((a9=ba.lastIndexOf("/"))!==ba.length-1){ba=ba.slice(0,a9+1)}return ba+a8}function ab(ba,a9){var a8=new Date();if(!aX){aZ.enqueueRequest(ba,u);x.expireDateTime=a8.getTime()+a9}}function H(a8){return a2+a8+"."+aF}function ac(a8){return f.cookie(H(a8))}function av(){aF=Y((B||aP)+(a3||"/")).slice(0,4)}function aR(){var a8=new Date();aA=a8.getTime()}function aK(){aj();aR()}function an(){var a8=(ah.compatMode&&ah.compatMode!="BackCompat")?ah.documentElement:ah.body;return[a8.scrollLeft||Z.pageXOffset,a8.scrollTop||Z.pageYOffset]}function ar(){var a9=an(); var a8=a9[0];ax=a8;al=a8;var ba=a9[1];ai=ba;U=ba}function aj(){var a9=an();var a8=a9[0];if(a8al){al=a8}}var ba=a9[1];if(baU){U=ba}}}function a0(ba,a9,a8,bc,bb){f.cookie(H("id"),ba+"."+a9+"."+a8+"."+bc+"."+bb,F,a3,B)}function aL(){var a9=new Date(),a8=Math.round(a9.getTime()/1000),bb=ac("id"),ba;if(bb){ba=bb.split(".");ba.unshift("0")}else{if(!ae){ae=Y((M.userAgent||"")+(M.platform||"")+i.stringify(aU)+a8).slice(0,16)}ba=["1",ae,a8,0,a8,""]}return ba}function ag(){var a9=new Date(),a8=a9.getTime();return a8}function X(a8){var bq,a9=new Date(),bf=Math.round(a9.getTime()/1000),bs,bj,bc,bm,bo,be,bd,bp,bb=1024,bt,bh,bl=H("id"),bg=H("ses"),bn=aL(),bk=ac("ses"),br=ak||a4,bi;if(aX&&P){f.cookie(bl,"",-1,a3,B);f.cookie(bg,"",-1,a3,B);return""}bs=bn[0];bj=bn[1];bm=bn[2];bc=bn[3];bo=bn[4];be=bn[5];if(!bk){bc++;be=bo}a8.addRaw("dtm",ag());a8.addRaw("tid",String(Math.random()).slice(2,8));a8.addRaw("vp",n.detectViewport());a8.addRaw("ds",n.detectDocumentSize());