From 65bc19b4dca9cd951c36bb5de39231aed2df85dd Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Sat, 1 Oct 2016 11:56:01 +1300 Subject: Track a unique id for each pageview (#10499) * track a unique id for each pageview * fix tests * reduce idpageview to 6 bytes * added changelog entry --- piwik.js | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'piwik.js') diff --git a/piwik.js b/piwik.js index da6dfce406..548d87f62e 100644 --- a/piwik.js +++ b/piwik.js @@ -36,32 +36,32 @@ if(ad){return ad}ad=U.findFirstNodeHavingAttribute(ac,this.CONTENT_TARGET_ATTR); }var ad=af.clientWidth;if(L.innerWidth&&ad>L.innerWidth){ad=L.innerWidth}var ac=af.clientHeight;if(L.innerHeight&&ac>L.innerHeight){ac=L.innerHeight}return((ag.bottom>0||ae)&&ag.right>0&&ag.left=0){cE=cE.slice(0,cD)}cD=cE.lastIndexOf("/");if(cD!==cE.length-1){cE=cE.slice(0,cD+1)}return cE+cC}function b8(cE,cC){var cD;cE=String(cE).toLowerCase();cC=String(cC).toLowerCase();if(cE===cC){return true}if(cC.slice(0,1)==="."){if(cE===cC.slice(1)){return true}cD=cE.length-cC.length;if((cD>0)&&(cE.slice(cD)===cC)){return true}}return false}function bQ(cC){var cD=document.createElement("a");if(cC.indexOf("//")!==0&&cC.indexOf("http")!==0){if(cC.indexOf("*")===0){cC=cC.substr(1) -}if(cC.indexOf(".")===0){cC=cC.substr(1)}cC="http://"+cC}cD.href=p.toAbsoluteUrl(cC);if(cD.pathname){return cD.pathname}return""}function aJ(cD,cC){if(!X(cC,"/")){cC="/"+cC}if(!X(cD,"/")){cD="/"+cD}var cE=(cC==="/"||cC==="/*");if(cE){return true}if(cD===cC){return true}cC=String(cC).toLowerCase();cD=String(cD).toLowerCase();if(J(cC,"*")){cC=cC.slice(0,-1);cE=(!cC||cC==="/");if(cE){return true}if(cD===cC){return true}return cD.indexOf(cC)===0}if(!J(cD,"/")){cD+="/"}if(!J(cC,"/")){cC+="/"}return cD.indexOf(cC)===0}function af(cG,cI){var cD,cC,cE,cF,cH;for(cD=0;cD0)&&(cF.slice(cE)===cC)){return true}}}return false}function bV(cC,cE){var cD=new Image(1,1);cD.onload=function(){x=0;if(typeof cE==="function"){cE() -}};cC=cC.replace("send_image=0","send_image=1");cD.src=am+(am.indexOf("?")<0?"?":"&")+cC}function cq(cD,cG,cC){if(!B(cC)||null===cC){cC=true}try{var cF=L.XMLHttpRequest?new L.XMLHttpRequest():L.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;cF.open("POST",am,true);cF.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)&&cC){bV(cD,cG)}else{if(this.readyState===4&&(typeof cG==="function")){cG()}}};cF.setRequestHeader("Content-Type",b0);cF.send(cD)}catch(cE){if(cC){bV(cD,cG)}}}function bM(cD){var cC=new Date();var cE=cC.getTime()+cD;if(!l||cE>l){l=cE}}function bT(cC){if(bI||!aL){return}bI=setTimeout(function cD(){bI=null;if(!aS){aS=(!y.hasFocus||y.hasFocus())}if(!aS){bT(aL);return}if(bo()){return}var cE=new Date(),cF=aL-(cE.getTime()-cm);cF=Math.min(aL,cF);bT(cF)},cC||aL)}function bh(){if(!bI){return}clearTimeout(bI);bI=null}function aP(){aS=true;if(bo()){return}bT()}function aj(){bh()}function cA(){if(av||!aL){return}av=true;aa(L,"focus",aP); -aa(L,"blur",aj);bT()}function b5(cG){var cD=new Date();var cC=cD.getTime();cm=cC;if(b4&&cCc1){cS.visitCount++; -cS.lastVisitTs=cS.currentVisitTs}if(!a5||!cK.length){for(cY in bW){if(Object.prototype.hasOwnProperty.call(bW,cY)){cK=N(c2,bW[cY]);if(cK.length){break}}}for(cY in be){if(Object.prototype.hasOwnProperty.call(be,cY)){cC=N(c2,be[cY]);if(cC.length){break}}}}c5=c(aZ);cN=cX.length?c(cX):"";if(c5.length&&!aC(c5)&&(!a5||!cN.length||aC(cN))){cX=aZ}if(cX.length||cK.length){cJ=cM;cW=[cK,cC,cJ,by(cX.slice(0,cG))];cy(cT,JSON2.stringify(cW),cr,a1,cl)}}cE+="&idsite="+bC+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+cD.getHours()+"&m="+cD.getMinutes()+"&s="+cD.getSeconds()+"&url="+n(by(c2))+(aZ.length?"&urlref="+n(by(aZ)):"")+((a8&&a8.length)?"&uid="+n(a8):"")+"&_id="+cS.uuid+"&_idts="+cS.createTs+"&_idvc="+cS.visitCount+"&_idn="+cS.newVisitor+(cK.length?"&_rcn="+n(cK):"")+(cC.length?"&_rck="+n(cC):"")+"&_refts="+cJ+"&_viewts="+cS.lastVisitTs+(String(cS.lastEcommerceOrderTs).length?"&_ects="+cS.lastEcommerceOrderTs:"")+(String(cX).length?"&_ref="+n(by(cX.slice(0,cG))):"")+(cP?"&cs="+n(cP):"")+"&send_image=0"; -for(cY in ct){if(Object.prototype.hasOwnProperty.call(ct,cY)){cE+="&"+cY+"="+ct[cY]}}var c4=[];if(cZ){for(cY in cZ){if(Object.prototype.hasOwnProperty.call(cZ,cY)&&/^dimension\d+$/.test(cY)){var cI=cY.replace("dimension","");c4.push(parseInt(cI,10));c4.push(String(cI));cE+="&"+cY+"="+cZ[cY];delete cZ[cY]}}}if(cZ&&u(cZ)){cZ=null}for(cY in aY){if(Object.prototype.hasOwnProperty.call(aY,cY)){var cO=(-1===E(c4,cY));if(cO){cE+="&dimension"+cY+"="+aY[cY]}}}if(cZ){cE+="&data="+n(JSON2.stringify(cZ))}else{if(ac){cE+="&data="+n(JSON2.stringify(ac))}}function cL(c6,c7){var c8=JSON2.stringify(c6);if(c8.length>2){return"&"+c7+"="+n(c8)}return""}var c3=cB(bs);var cU=cB(bR);cE+=cL(c3,"cvar");cE+=cL(cU,"e_cvar");if(ax){cE+=cL(ax,"_cvar");for(cY in cV){if(Object.prototype.hasOwnProperty.call(cV,cY)){if(ax[cY][0]===""||ax[cY][1]===""){delete ax[cY]}}}if(bn){cy(cQ,JSON2.stringify(ax),bU,a1,cl)}}if(aI){if(bS){cE+=">_ms="+bS}else{if(g&&g.timing&&g.timing.requestStart&&g.timing.responseEnd){cE+=">_ms="+(g.timing.responseEnd-g.timing.requestStart) -}}}cS.lastEcommerceOrderTs=B(cF)&&String(cF).length?cF:cS.lastEcommerceOrderTs;at(cS);bJ();cE+=S(c0);if(cn.length){cE+="&"+cn}if(t(bH)){cE=bH(cE)}return cE}bo=function aM(){var cC=new Date();if(cm+aL<=cC.getTime()){var cD=bX("ping=1",null,"ping");bd(cD,bg);return true}return false};function a2(cF,cE,cK,cG,cC,cN){var cI="idgoal=0",cJ,cD=new Date(),cL=[],cM,cH=String(cF).length;if(cH){cI+="&ec_id="+n(cF);cJ=Math.round(cD.getTime()/1000)}cI+="&revenue="+cE;if(String(cK).length){cI+="&ec_st="+cK}if(String(cG).length){cI+="&ec_tx="+cG}if(String(cC).length){cI+="&ec_sh="+cC}if(String(cN).length){cI+="&ec_dt="+cN}if(co){for(cM in co){if(Object.prototype.hasOwnProperty.call(co,cM)){if(!B(co[cM][1])){co[cM][1]=""}if(!B(co[cM][2])){co[cM][2]=""}if(!B(co[cM][3])||String(co[cM][3]).length===0){co[cM][3]=0}if(!B(co[cM][4])||String(co[cM][4]).length===0){co[cM][4]=1}cL.push(co[cM])}}cI+="&ec_items="+n(JSON2.stringify(cL))}cI=bX(cI,ac,"ecommerce",cJ);bd(cI,bg);if(cH){co={}}}function bv(cC,cG,cF,cE,cD,cH){if(String(cC).length&&B(cG)){a2(cC,cG,cF,cE,cD,cH) -}}function a3(cC){if(B(cC)){a2("",cC,"","","","")}}function bw(cD,cF,cE){var cC=bX("action_name="+n(ab(cD||aV)),cF,"log");bd(cC,bg,cE)}function aG(cE,cD){var cF,cC="(^| )(piwik[_-]"+cD;if(cE){for(cF=0;cF0){cG=parseInt(cG,10);cJ(cG)}})}function b7(){var cD,cF,cG={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(!((new RegExp("MSIE")).test(f.userAgent))){if(f.mimeTypes&&f.mimeTypes.length){for(cD in cG){if(Object.prototype.hasOwnProperty.call(cG,cD)){cF=f.mimeTypes[cG[cD]];ct[cD]=(cF&&cF.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&B(f.javaEnabled)&&f.javaEnabled()){ct.java="1"}if(t(L.GearsFactory)){ct.gears="1"}ct.cookie=bB()}var cE=parseInt(P.width,10);var cC=parseInt(P.height,10);ct.res=parseInt(cE,10)+"x"+parseInt(cC,10)}b7();aU();at();this.getVisitorId=function(){return aE().uuid};this.getVisitorInfo=function(){return cd()};this.getAttributionInfo=function(){return bj()};this.getAttributionCampaignName=function(){return bj()[0] -};this.getAttributionCampaignKeyword=function(){return bj()[1]};this.getAttributionReferrerTimestamp=function(){return bj()[2]};this.getAttributionReferrerUrl=function(){return bj()[3]};this.setTrackerUrl=function(cC){am=cC};this.getTrackerUrl=function(){return am};this.addTracker=function(cC,cE){if(!cE){throw new Error("A siteId must be given to add a new tracker")}if(!B(cC)||null===cC){cC=this.getTrackerUrl()}var cD=new I(cC,cE);A.push(cD);return cD};this.getSiteId=function(){return bC};this.setSiteId=function(cC){bz(cC)};this.setUserId=function(cC){if(!B(cC)||!cC.length){return}a8=cC;bl=bD(a8).substr(0,16)};this.getUserId=function(){return a8};this.setCustomData=function(cC,cD){if(O(cC)){ac=cC}else{if(!ac){ac={}}ac[cC]=cD}};this.getCustomData=function(){return ac};this.setCustomRequestProcessing=function(cC){bH=cC};this.appendToTrackingUrl=function(cC){cn=cC};this.getRequest=function(cC){return bX(cC)};this.addPlugin=function(cC,cD){a[cC]=cD};this.setCustomDimension=function(cC,cD){cC=parseInt(cC,10); -if(cC>0){if(!B(cD)){cD=""}if(!q(cD)){cD=String(cD)}aY[cC]=cD}};this.getCustomDimension=function(cC){cC=parseInt(cC,10);if(cC>0&&Object.prototype.hasOwnProperty.call(aY,cC)){return aY[cC]}};this.deleteCustomDimension=function(cC){cC=parseInt(cC,10);if(cC>0){delete aY[cC]}};this.setCustomVariable=function(cD,cC,cG,cE){var cF;if(!B(cE)){cE="visit"}if(!B(cC)){return}if(!B(cG)){cG=""}if(cD>0){cC=!q(cC)?String(cC):cC;cG=!q(cG)?String(cG):cG;cF=[cC.slice(0,a4),cG.slice(0,a4)];if(cE==="visit"||cE===2){b6();ax[cD]=cF}else{if(cE==="page"||cE===3){bs[cD]=cF}else{if(cE==="event"){bR[cD]=cF}}}}};this.getCustomVariable=function(cD,cE){var cC;if(!B(cE)){cE="visit"}if(cE==="page"||cE===3){cC=bs[cD]}else{if(cE==="event"){cC=bR[cD]}else{if(cE==="visit"||cE===2){b6();cC=ax[cD]}}}if(!B(cC)||(cC&&cC[0]==="")){return false}return cC};this.deleteCustomVariable=function(cC,cD){if(this.getCustomVariable(cC,cD)){this.setCustomVariable(cC,"","",cD)}};this.storeCustomVariablesInCookie=function(){bn=true};this.setLinkTrackingTimer=function(cC){bg=cC -};this.setDownloadExtensions=function(cC){if(q(cC)){cC=cC.split("|")}cs=cC};this.addDownloadExtensions=function(cD){var cC;if(q(cD)){cD=cD.split("|")}for(cC=0;cC1){Y("The method "+ad+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers') +}}L.name=ak+"###"+ah+"###"+ac+"###"+af}var aj=L.name.split("###");return aj.length===4&&aj[0]===ak}function Q(ad,aj,af){var ai=L.name.split("###"),ah=ai[1],ac=ai[2],ag=ai[3],ae=G(ad,aj);j(ae+"plugins/Overlay/client/client.js?v=1",function(){Piwik_Overlay_Client.initialize(ae,af,ah,ac,ag)})}function o(){var ae;try{ae=L.frameElement}catch(ad){return true}if(B(ae)){return(ae&&String(ae.nodeName).toLowerCase()==="iframe")?true:false}try{return L.self!==L.top}catch(ac){return true}}function I(bM,bG){var bC=R(y.domain,L.location.href,C()),cl=D(bC[0]),bm=k(bC[1]),a1=k(bC[2]),cj=false,bQ="GET",cx=bQ,aq="application/x-www-form-urlencoded; charset=UTF-8",b2=aq,am=bM||"",bh="",cp="",bE=bG||"",ba="",bn="",aL,aX="",cu=["7z","aac","apk","arc","arj","asf","asx","avi","azw3","bin","csv","deb","dmg","doc","docx","epub","exe","flv","gif","gz","gzip","hqx","ibooks","jar","jpg","jpeg","js","mobi","mp2","mp3","mp4","mpg","mpeg","mov","movie","msi","msp","odb","odf","odg","ods","odt","ogg","ogv","pdf","phps","png","ppt","pptx","qt","qtm","ra","ram","rar","rpm","sea","sit","tar","tbz","tbz2","bz","bz2","tgz","torrent","txt","wav","wma","wmv","wpd","xls","xlsx","xml","z","zip"],ai=[cl],bb=[],bk=[],aO=[],bi=500,cc,aM,bq,bo,ac,bY=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],bg=["pk_kwd","piwik_kwd","utm_term"],aY="_pk_",cn,a3,aZ=false,ch,aU,a7,cd=33955200000,bW=1800000,ct=15768000000,aJ=true,bU=0,bp=false,ay=false,bJ,bu={},bT={},a0={},a6=200,cq={},cv={},bI=[],bN=false,b6=false,ad=false,cw=false,aw=false,aT=o(),co=null,bK,az,bc,bF=Z,a2,at; +try{aX=y.title}catch(b4){aX=""}function cA(cK,cH,cG,cJ,cF,cI){if(aZ){return}var cE;if(cG){cE=new Date();cE.setTime(cE.getTime()+cG)}y.cookie=cK+"="+n(cH)+(cG?";expires="+cE.toGMTString():"")+";path="+(cJ||"/")+(cF?";domain="+cF:"")+(cI?";secure":"")}function al(cG){if(aZ){return 0}var cE=new RegExp("(^|;)[ ]*"+cG+"=([^;]*)"),cF=cE.exec(y.cookie);return cF?K(cF[2]):0}function bA(cE){var cF;if(bo){cF=new RegExp("#.*");return cE.replace(cF,"")}return cE}function bt(cG,cE){var cH=m(cE),cF;if(cH){return cE}if(cE.slice(0,1)==="/"){return m(cG)+"://"+c(cG)+cE}cG=bA(cG);cF=cG.indexOf("?");if(cF>=0){cG=cG.slice(0,cF)}cF=cG.lastIndexOf("/");if(cF!==cG.length-1){cG=cG.slice(0,cF+1)}return cG+cE}function ca(cG,cE){var cF;cG=String(cG).toLowerCase();cE=String(cE).toLowerCase();if(cG===cE){return true}if(cE.slice(0,1)==="."){if(cG===cE.slice(1)){return true}cF=cG.length-cE.length;if((cF>0)&&(cG.slice(cF)===cE)){return true}}return false}function bS(cE){var cF=document.createElement("a");if(cE.indexOf("//")!==0&&cE.indexOf("http")!==0){if(cE.indexOf("*")===0){cE=cE.substr(1) +}if(cE.indexOf(".")===0){cE=cE.substr(1)}cE="http://"+cE}cF.href=p.toAbsoluteUrl(cE);if(cF.pathname){return cF.pathname}return""}function aK(cF,cE){if(!X(cE,"/")){cE="/"+cE}if(!X(cF,"/")){cF="/"+cF}var cG=(cE==="/"||cE==="/*");if(cG){return true}if(cF===cE){return true}cE=String(cE).toLowerCase();cF=String(cF).toLowerCase();if(J(cE,"*")){cE=cE.slice(0,-1);cG=(!cE||cE==="/");if(cG){return true}if(cF===cE){return true}return cF.indexOf(cE)===0}if(!J(cF,"/")){cF+="/"}if(!J(cE,"/")){cE+="/"}return cF.indexOf(cE)===0}function af(cI,cK){var cF,cE,cG,cH,cJ;for(cF=0;cF0)&&(cH.slice(cG)===cE)){return true}}}return false}function bX(cE,cG){var cF=new Image(1,1);cF.onload=function(){x=0;if(typeof cG==="function"){cG() +}};cE=cE.replace("send_image=0","send_image=1");cF.src=am+(am.indexOf("?")<0?"?":"&")+cE}function cs(cF,cI,cE){if(!B(cE)||null===cE){cE=true}try{var cH=L.XMLHttpRequest?new L.XMLHttpRequest():L.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;cH.open("POST",am,true);cH.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)&&cE){bX(cF,cI)}else{if(this.readyState===4&&(typeof cI==="function")){cI()}}};cH.setRequestHeader("Content-Type",b2);cH.send(cF)}catch(cG){if(cE){bX(cF,cI)}}}function bO(cF){var cE=new Date();var cG=cE.getTime()+cF;if(!l||cG>l){l=cG}}function bV(cE){if(bK||!aM){return}bK=setTimeout(function cF(){bK=null;if(!aT){aT=(!y.hasFocus||y.hasFocus())}if(!aT){bV(aM);return}if(bq()){return}var cG=new Date(),cH=aM-(cG.getTime()-co);cH=Math.min(aM,cH);bV(cH)},cE||aM)}function bj(){if(!bK){return}clearTimeout(bK);bK=null}function aQ(){aT=true;if(bq()){return}bV()}function aj(){bj()}function cC(){if(aw||!aM){return}aw=true;aa(L,"focus",aQ); +aa(L,"blur",aj);bV()}function b7(cI){var cF=new Date();var cE=cF.getTime();co=cE;if(b6&&cEc3){cU.visitCount++;cU.lastVisitTs=cU.currentVisitTs}if(!a7||!cM.length){for(c0 in bY){if(Object.prototype.hasOwnProperty.call(bY,c0)){cM=N(c4,bY[c0]);if(cM.length){break}}}for(c0 in bg){if(Object.prototype.hasOwnProperty.call(bg,c0)){cE=N(c4,bg[c0]);if(cE.length){break}}}}c7=c(a1);cP=cZ.length?c(cZ):"";if(c7.length&&!aD(c7)&&(!a7||!cP.length||aD(cP))){cZ=a1}if(cZ.length||cM.length){cL=cO;cY=[cM,cE,cL,bA(cZ.slice(0,cI))];cA(cV,JSON2.stringify(cY),ct,a3,cn)}}cG+="&idsite="+bE+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+cF.getHours()+"&m="+cF.getMinutes()+"&s="+cF.getSeconds()+"&url="+n(bA(c4))+(a1.length?"&urlref="+n(bA(a1)):"")+((ba&&ba.length)?"&uid="+n(ba):"")+"&_id="+cU.uuid+"&_idts="+cU.createTs+"&_idvc="+cU.visitCount+"&_idn="+cU.newVisitor+(cM.length?"&_rcn="+n(cM):"")+(cE.length?"&_rck="+n(cE):"")+"&_refts="+cL+"&_viewts="+cU.lastVisitTs+(String(cU.lastEcommerceOrderTs).length?"&_ects="+cU.lastEcommerceOrderTs:"")+(String(cZ).length?"&_ref="+n(bA(cZ.slice(0,cI))):"")+(cR?"&cs="+n(cR):"")+"&send_image=0"; +for(c0 in cv){if(Object.prototype.hasOwnProperty.call(cv,c0)){cG+="&"+c0+"="+cv[c0]}}var c6=[];if(c1){for(c0 in c1){if(Object.prototype.hasOwnProperty.call(c1,c0)&&/^dimension\d+$/.test(c0)){var cK=c0.replace("dimension","");c6.push(parseInt(cK,10));c6.push(String(cK));cG+="&"+c0+"="+c1[c0];delete c1[c0]}}}if(c1&&u(c1)){c1=null}for(c0 in a0){if(Object.prototype.hasOwnProperty.call(a0,c0)){var cQ=(-1===E(c6,c0));if(cQ){cG+="&dimension"+c0+"="+a0[c0]}}}if(c1){cG+="&data="+n(JSON2.stringify(c1))}else{if(ac){cG+="&data="+n(JSON2.stringify(ac))}}function cN(c8,c9){var da=JSON2.stringify(c8);if(da.length>2){return"&"+c9+"="+n(da)}return""}var c5=cD(bu);var cW=cD(bT);cG+=cN(c5,"cvar");cG+=cN(cW,"e_cvar");if(ay){cG+=cN(ay,"_cvar");for(c0 in cX){if(Object.prototype.hasOwnProperty.call(cX,c0)){if(ay[c0][0]===""||ay[c0][1]===""){delete ay[c0]}}}if(bp){cA(cS,JSON2.stringify(ay),bW,a3,cn)}}if(aJ){if(bU){cG+=">_ms="+bU}else{if(g&&g.timing&&g.timing.requestStart&&g.timing.responseEnd){cG+=">_ms="+(g.timing.responseEnd-g.timing.requestStart) +}}}if(at){cG+="&pv_id="+at}cU.lastEcommerceOrderTs=B(cH)&&String(cH).length?cH:cU.lastEcommerceOrderTs;au(cU);bL();cG+=S(c2);if(cp.length){cG+="&"+cp}if(t(bJ)){cG=bJ(cG)}return cG}bq=function aN(){var cE=new Date();if(co+aM<=cE.getTime()){var cF=bZ("ping=1",null,"ping");bf(cF,bi);return true}return false};function a4(cH,cG,cM,cI,cE,cP){var cK="idgoal=0",cL,cF=new Date(),cN=[],cO,cJ=String(cH).length;if(cJ){cK+="&ec_id="+n(cH);cL=Math.round(cF.getTime()/1000)}cK+="&revenue="+cG;if(String(cM).length){cK+="&ec_st="+cM}if(String(cI).length){cK+="&ec_tx="+cI}if(String(cE).length){cK+="&ec_sh="+cE}if(String(cP).length){cK+="&ec_dt="+cP}if(cq){for(cO in cq){if(Object.prototype.hasOwnProperty.call(cq,cO)){if(!B(cq[cO][1])){cq[cO][1]=""}if(!B(cq[cO][2])){cq[cO][2]=""}if(!B(cq[cO][3])||String(cq[cO][3]).length===0){cq[cO][3]=0}if(!B(cq[cO][4])||String(cq[cO][4]).length===0){cq[cO][4]=1}cN.push(cq[cO])}}cK+="&ec_items="+n(JSON2.stringify(cN))}cK=bZ(cK,ac,"ecommerce",cL);bf(cK,bi);if(cJ){cq={}}}function bx(cE,cI,cH,cG,cF,cJ){if(String(cE).length&&B(cI)){a4(cE,cI,cH,cG,cF,cJ) +}}function a5(cE){if(B(cE)){a4("",cE,"","","","")}}function by(cF,cH,cG){at=aV();var cE=bZ("action_name="+n(ab(cF||aX)),cH,"log");bf(cE,bi,cG)}function aH(cG,cF){var cH,cE="(^| )(piwik[_-]"+cF;if(cG){for(cH=0;cH0){cI=parseInt(cI,10);cL(cI)}})}function b9(){var cF,cH,cI={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(!((new RegExp("MSIE")).test(f.userAgent))){if(f.mimeTypes&&f.mimeTypes.length){for(cF in cI){if(Object.prototype.hasOwnProperty.call(cI,cF)){cH=f.mimeTypes[cI[cF]];cv[cF]=(cH&&cH.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&B(f.javaEnabled)&&f.javaEnabled()){cv.java="1"}if(t(L.GearsFactory)){cv.gears="1"}cv.cookie=bD()}var cG=parseInt(P.width,10);var cE=parseInt(P.height,10);cv.res=parseInt(cG,10)+"x"+parseInt(cE,10)}b9();aW();au();this.getVisitorId=function(){return aF().uuid};this.getVisitorInfo=function(){return cf()};this.getAttributionInfo=function(){return bl()};this.getAttributionCampaignName=function(){return bl()[0] +};this.getAttributionCampaignKeyword=function(){return bl()[1]};this.getAttributionReferrerTimestamp=function(){return bl()[2]};this.getAttributionReferrerUrl=function(){return bl()[3]};this.setTrackerUrl=function(cE){am=cE};this.getTrackerUrl=function(){return am};this.addTracker=function(cE,cG){if(!cG){throw new Error("A siteId must be given to add a new tracker")}if(!B(cE)||null===cE){cE=this.getTrackerUrl()}var cF=new I(cE,cG);A.push(cF);return cF};this.getSiteId=function(){return bE};this.setSiteId=function(cE){bB(cE)};this.setUserId=function(cE){if(!B(cE)||!cE.length){return}ba=cE;bn=bF(ba).substr(0,16)};this.getUserId=function(){return ba};this.setCustomData=function(cE,cF){if(O(cE)){ac=cE}else{if(!ac){ac={}}ac[cE]=cF}};this.getCustomData=function(){return ac};this.setCustomRequestProcessing=function(cE){bJ=cE};this.appendToTrackingUrl=function(cE){cp=cE};this.getRequest=function(cE){return bZ(cE)};this.addPlugin=function(cE,cF){a[cE]=cF};this.setCustomDimension=function(cE,cF){cE=parseInt(cE,10); +if(cE>0){if(!B(cF)){cF=""}if(!q(cF)){cF=String(cF)}a0[cE]=cF}};this.getCustomDimension=function(cE){cE=parseInt(cE,10);if(cE>0&&Object.prototype.hasOwnProperty.call(a0,cE)){return a0[cE]}};this.deleteCustomDimension=function(cE){cE=parseInt(cE,10);if(cE>0){delete a0[cE]}};this.setCustomVariable=function(cF,cE,cI,cG){var cH;if(!B(cG)){cG="visit"}if(!B(cE)){return}if(!B(cI)){cI=""}if(cF>0){cE=!q(cE)?String(cE):cE;cI=!q(cI)?String(cI):cI;cH=[cE.slice(0,a6),cI.slice(0,a6)];if(cG==="visit"||cG===2){b8();ay[cF]=cH}else{if(cG==="page"||cG===3){bu[cF]=cH}else{if(cG==="event"){bT[cF]=cH}}}}};this.getCustomVariable=function(cF,cG){var cE;if(!B(cG)){cG="visit"}if(cG==="page"||cG===3){cE=bu[cF]}else{if(cG==="event"){cE=bT[cF]}else{if(cG==="visit"||cG===2){b8();cE=ay[cF]}}}if(!B(cE)||(cE&&cE[0]==="")){return false}return cE};this.deleteCustomVariable=function(cE,cF){if(this.getCustomVariable(cE,cF)){this.setCustomVariable(cE,"","",cF)}};this.storeCustomVariablesInCookie=function(){bp=true};this.setLinkTrackingTimer=function(cE){bi=cE +};this.setDownloadExtensions=function(cE){if(q(cE)){cE=cE.split("|")}cu=cE};this.addDownloadExtensions=function(cF){var cE;if(q(cF)){cF=cF.split("|")}for(cE=0;cE1){Y("The method "+ad+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers') }ai[ad]++}}}}return ah}var v=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"];function T(ac,ae){var ad=new I(ac,ae);A.push(ad);_paq=b(_paq,v);for(x=0;x<_paq.length;x++){if(_paq[x]){V(_paq[x])}}_paq=new z();return ad}aa(L,"beforeunload",W,false);Date.prototype.getTimeAlias=Date.prototype.getTime;d={initialized:false,on:function(ad,ac){if(!r[ad]){r[ad]=[]}r[ad].push(ac)},off:function(ae,ad){if(!r[ae]){return}var ac=0;for(ac;ac