From ba8e9b8f16a007289e03785b0db13c7cc2e1a890 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 1 Dec 2016 14:39:18 +1300 Subject: =?UTF-8?q?Enable=20by=20default=20Downloads=20and=20Outlinks=20tr?= =?UTF-8?q?acking=20of=20righ=E2=80=A6=20(#10901)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Piwik JavaScript tracker: we now track by default Downloads and Outlinks when user clicks on the mouse right button or the mouse middle button --- piwik.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'piwik.js') diff --git a/piwik.js b/piwik.js index 6fa09e8deb..f467468a49 100644 --- a/piwik.js +++ b/piwik.js @@ -53,20 +53,20 @@ if(cH&&cH.name===cG.name&&cH.piece===cG.piece&&cH.target===cG.target){return tru var cK;if(cG){cK=cG.target||cG.srcElement}if(!cK){cK=cF}if(!aT(cJ,cK)){return}bP(bj);if(W.isLinkElement(cF)&&W.hasNodeAttributeWithValue(cF,"href")&&W.hasNodeAttributeWithValue(cF,r.CONTENT_TARGET_ATTR)){var cH=W.getAttributeValueFromNode(cF,"href");if(!aE(cH)&&cF.wasContentTargetAttrReplaced){W.setAnyAttribute(cF,r.CONTENT_TARGET_ATTR,"")}}var cO=cz(cF);if(ag&&cO&&cO.type){return cO.type}if(bf(cJ)){return"href"}var cL=r.buildContentBlock(cJ);if(!cL){return}var cI=cL.name;var cP=cL.piece;var cN=cL.target;var cM=az("click",cI,cP,cN);bg(cM,bj);return cM}}function bA(cH){if(!cH||!cH.length){return}var cF,cG;for(cF=0;cF0){cJ=parseInt(cJ,10);cM(cJ)}})}function ca(){var cG,cI,cJ={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(cG in cJ){if(Object.prototype.hasOwnProperty.call(cJ,cG)){cI=f.mimeTypes[cJ[cG]];cw[cG]=(cI&&cI.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&D(f.javaEnabled)&&f.javaEnabled()){cw.java="1"}if(v(N.GearsFactory)){cw.gears="1" -}cw.cookie=bE()}var cH=parseInt(R.width,10);var cF=parseInt(R.height,10);cw.res=parseInt(cH,10)+"x"+parseInt(cF,10)}ca();aX();aw();this.getVisitorId=function(){return aH().uuid};this.getVisitorInfo=function(){return cg()};this.getAttributionInfo=function(){return bm()};this.getAttributionCampaignName=function(){return bm()[0]};this.getAttributionCampaignKeyword=function(){return bm()[1]};this.getAttributionReferrerTimestamp=function(){return bm()[2]};this.getAttributionReferrerUrl=function(){return bm()[3]};this.setTrackerUrl=function(cF){ap=cF};this.getTrackerUrl=function(){return ap};this.addTracker=function(cF,cH){if(!cH){throw new Error("A siteId must be given to add a new tracker")}if(!D(cF)||null===cF){cF=this.getTrackerUrl()}var cG=new K(cF,cH);C.push(cG);return cG};this.getSiteId=function(){return bF};this.setSiteId=function(cF){bC(cF)};this.setUserId=function(cF){if(!D(cF)||!cF.length){return}bb=cF;bo=bG(bb).substr(0,16)};this.getUserId=function(){return bb};this.setCustomData=function(cF,cG){if(Q(cF)){af=cF -}else{if(!af){af={}}af[cF]=cG}};this.getCustomData=function(){return af};this.setCustomRequestProcessing=function(cF){bK=cF};this.appendToTrackingUrl=function(cF){cq=cF};this.getRequest=function(cF){return b0(cF)};this.addPlugin=function(cF,cG){a[cF]=cG};this.setCustomDimension=function(cF,cG){cF=parseInt(cF,10);if(cF>0){if(!D(cG)){cG=""}if(!s(cG)){cG=String(cG)}a1[cF]=cG}};this.getCustomDimension=function(cF){cF=parseInt(cF,10);if(cF>0&&Object.prototype.hasOwnProperty.call(a1,cF)){return a1[cF]}};this.deleteCustomDimension=function(cF){cF=parseInt(cF,10);if(cF>0){delete a1[cF]}};this.setCustomVariable=function(cG,cF,cJ,cH){var cI;if(!D(cH)){cH="visit"}if(!D(cF)){return}if(!D(cJ)){cJ=""}if(cG>0){cF=!s(cF)?String(cF):cF;cJ=!s(cJ)?String(cJ):cJ;cI=[cF.slice(0,a7),cJ.slice(0,a7)];if(cH==="visit"||cH===2){b9();aA[cG]=cI}else{if(cH==="page"||cH===3){bv[cG]=cI}else{if(cH==="event"){bU[cG]=cI}}}}};this.getCustomVariable=function(cG,cH){var cF;if(!D(cH)){cH="visit"}if(cH==="page"||cH===3){cF=bv[cG] -}else{if(cH==="event"){cF=bU[cG]}else{if(cH==="visit"||cH===2){b9();cF=aA[cG]}}}if(!D(cF)||(cF&&cF[0]==="")){return false}return cF};this.deleteCustomVariable=function(cF,cG){if(this.getCustomVariable(cF,cG)){this.setCustomVariable(cF,"","",cG)}};this.storeCustomVariablesInCookie=function(){bq=true};this.setLinkTrackingTimer=function(cF){bj=cF};this.setDownloadExtensions=function(cF){if(s(cF)){cF=cF.split("|")}cv=cF};this.addDownloadExtensions=function(cG){var cF;if(s(cG)){cG=cG.split("|")}for(cF=0;cF1){ab("The method "+ag+' 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')}al[ag]++}}}}return ak}var x=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"];function V(af,ah){var ag=new K(af,ah);C.push(ag);_paq=b(_paq,x);for(z=0;z<_paq.length; -z++){if(_paq[z]){X(_paq[z])}}_paq=new B();return ag}ae(N,"beforeunload",Z,false);Date.prototype.getTimeAlias=Date.prototype.getTime;d={initialized:false,DOM:{addEventListener:function(ai,ah,ag,af){var aj=typeof af;if(aj==="undefined"){af=false}ae(ai,ah,ag,af)},onLoad:j,onReady:m},on:function(ag,af){if(!t[ag]){t[ag]=[]}t[ag].push(af)},off:function(ah,ag){if(!t[ah]){return}var af=0;for(af;af0){cJ=parseInt(cJ,10);cM(cJ)}})}function ca(){var cG,cI,cJ={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(cG in cJ){if(Object.prototype.hasOwnProperty.call(cJ,cG)){cI=f.mimeTypes[cJ[cG]];cw[cG]=(cI&&cI.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&D(f.javaEnabled)&&f.javaEnabled()){cw.java="1" +}if(v(N.GearsFactory)){cw.gears="1"}cw.cookie=bE()}var cH=parseInt(R.width,10);var cF=parseInt(R.height,10);cw.res=parseInt(cH,10)+"x"+parseInt(cF,10)}ca();aX();aw();this.getVisitorId=function(){return aH().uuid};this.getVisitorInfo=function(){return cg()};this.getAttributionInfo=function(){return bm()};this.getAttributionCampaignName=function(){return bm()[0]};this.getAttributionCampaignKeyword=function(){return bm()[1]};this.getAttributionReferrerTimestamp=function(){return bm()[2]};this.getAttributionReferrerUrl=function(){return bm()[3]};this.setTrackerUrl=function(cF){ap=cF};this.getTrackerUrl=function(){return ap};this.addTracker=function(cF,cH){if(!cH){throw new Error("A siteId must be given to add a new tracker")}if(!D(cF)||null===cF){cF=this.getTrackerUrl()}var cG=new K(cF,cH);C.push(cG);return cG};this.getSiteId=function(){return bF};this.setSiteId=function(cF){bC(cF)};this.setUserId=function(cF){if(!D(cF)||!cF.length){return}bb=cF;bo=bG(bb).substr(0,16)};this.getUserId=function(){return bb +};this.setCustomData=function(cF,cG){if(Q(cF)){af=cF}else{if(!af){af={}}af[cF]=cG}};this.getCustomData=function(){return af};this.setCustomRequestProcessing=function(cF){bK=cF};this.appendToTrackingUrl=function(cF){cq=cF};this.getRequest=function(cF){return b0(cF)};this.addPlugin=function(cF,cG){a[cF]=cG};this.setCustomDimension=function(cF,cG){cF=parseInt(cF,10);if(cF>0){if(!D(cG)){cG=""}if(!s(cG)){cG=String(cG)}a1[cF]=cG}};this.getCustomDimension=function(cF){cF=parseInt(cF,10);if(cF>0&&Object.prototype.hasOwnProperty.call(a1,cF)){return a1[cF]}};this.deleteCustomDimension=function(cF){cF=parseInt(cF,10);if(cF>0){delete a1[cF]}};this.setCustomVariable=function(cG,cF,cJ,cH){var cI;if(!D(cH)){cH="visit"}if(!D(cF)){return}if(!D(cJ)){cJ=""}if(cG>0){cF=!s(cF)?String(cF):cF;cJ=!s(cJ)?String(cJ):cJ;cI=[cF.slice(0,a7),cJ.slice(0,a7)];if(cH==="visit"||cH===2){b9();aA[cG]=cI}else{if(cH==="page"||cH===3){bv[cG]=cI}else{if(cH==="event"){bU[cG]=cI}}}}};this.getCustomVariable=function(cG,cH){var cF; +if(!D(cH)){cH="visit"}if(cH==="page"||cH===3){cF=bv[cG]}else{if(cH==="event"){cF=bU[cG]}else{if(cH==="visit"||cH===2){b9();cF=aA[cG]}}}if(!D(cF)||(cF&&cF[0]==="")){return false}return cF};this.deleteCustomVariable=function(cF,cG){if(this.getCustomVariable(cF,cG)){this.setCustomVariable(cF,"","",cG)}};this.storeCustomVariablesInCookie=function(){bq=true};this.setLinkTrackingTimer=function(cF){bj=cF};this.setDownloadExtensions=function(cF){if(s(cF)){cF=cF.split("|")}cv=cF};this.addDownloadExtensions=function(cG){var cF;if(s(cG)){cG=cG.split("|")}for(cF=0;cF1){ab("The method "+ag+' 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')}al[ag]++}}}}return ak}var x=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","enableLinkTracking"]; +function V(af,ah){var ag=new K(af,ah);C.push(ag);_paq=b(_paq,x);for(z=0;z<_paq.length;z++){if(_paq[z]){X(_paq[z])}}_paq=new B();return ag}ae(N,"beforeunload",Z,false);Date.prototype.getTimeAlias=Date.prototype.getTime;d={initialized:false,DOM:{addEventListener:function(ai,ah,ag,af){var aj=typeof af;if(aj==="undefined"){af=false}ae(ai,ah,ag,af)},onLoad:j,onReady:m},on:function(ag,af){if(!t[ag]){t[ag]=[]}t[ag].push(af)},off:function(ah,ag){if(!t[ah]){return}var af=0;for(af;af