Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2020-05-06 10:16:52 +0300
committerGitHub <noreply@github.com>2020-05-06 10:16:52 +0300
commite85965095dc4d75eece83b43fc164324452c5e75 (patch)
treed2463e5301b730825d1c49341487743ac9e46c76 /matomo.js
parent591ed0e5d4a8e3c7229270206bb4aab454fb0248 (diff)
Search for links on page load as well, not just on ready (#15915)
* Search for links on page load as well, not just on ready refs https://github.com/matomo-org/matomo/issues/15780 It's absolutely not solving #15780 but it can already greatly improve the situation where links are added between DOM Ready and DOM load. Putting this into 3.x as was looking into this as part of Matomo for WordPress https://wordpress.org/support/topic/tracking-downloads-served-through-zotpress/#post-12787301 * rebuilt piwik.js
Diffstat (limited to 'matomo.js')
-rw-r--r--matomo.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/matomo.js b/matomo.js
index b7c9043497..30b80905b2 100644
--- a/matomo.js
+++ b/matomo.js
@@ -65,7 +65,7 @@ if(!dk||aU(dk)){return}dk=k(dk,av);var dl=bq();dk=F(dk,av,dl);ae.setAnyAttribute
}else{if(dl==="visit"||dl===2){cD();dj=aQ[dk]}}}if(!J(dj)||(dj&&dj[0]==="")){return false}return dj};this.deleteCustomVariable=function(dj,dk){if(this.getCustomVariable(dj,dk)){this.setCustomVariable(dj,"","",dk)}};this.deleteCustomVariables=function(dj){if(dj==="page"||dj===3){bV={}}else{if(dj==="event"){cl={}}else{if(dj==="visit"||dj===2){aQ={}}}}};this.storeCustomVariablesInCookie=function(){bP=true};this.setLinkTrackingTimer=function(dj){bI=dj};this.getLinkTrackingTimer=function(){return bI};this.setDownloadExtensions=function(dj){if(w(dj)){dj=dj.split("|")}c6=dj};this.addDownloadExtensions=function(dk){var dj;if(w(dk)){dk=dk.split("|")}for(dj=0;dj<dk.length;dj++){c6.push(dk[dj])}};this.removeDownloadExtensions=function(dl){var dk,dj=[];if(w(dl)){dl=dl.split("|")}for(dk=0;dk<c6.length;dk++){if(M(dl,c6[dk])===-1){dj.push(c6[dk])}}c6=dj};this.setDomains=function(dj){ax=w(dj)?[dj]:dj;var dn=false,dl=0,dk;for(dl;dl<ax.length;dl++){dk=String(ax[dl]);if(cF(cU,L(dk))){dn=true;break}var dm=ck(dk);
if(dm&&dm!=="/"&&dm!=="/*"){dn=true;break}}if(!dn){ax.push(cU)}};this.enableCrossDomainLinking=function(){cM=true};this.disableCrossDomainLinking=function(){cM=false};this.isCrossDomainLinkingEnabled=function(){return cM};this.setCrossDomainLinkingTimeout=function(dj){aZ=dj};this.getCrossDomainLinkingUrlParameter=function(){return t(av)+"="+t(bq())};this.setIgnoreClasses=function(dj){by=w(dj)?[dj]:dj};this.setRequestMethod=function(dj){da=dj||ch};this.setRequestContentType=function(dj){cw=dj||aH};this.setReferrerUrl=function(dj){bm=dj};this.setCustomUrl=function(dj){a4=bU(bM,dj)};this.getCurrentUrl=function(){return a4||bM};this.setDocumentTitle=function(dj){bi=dj};this.setAPIUrl=function(dj){bG=dj};this.setDownloadClasses=function(dj){bK=w(dj)?[dj]:dj};this.setLinkClasses=function(dj){a8=w(dj)?[dj]:dj};this.setCampaignNameKey=function(dj){cq=w(dj)?[dj]:dj};this.setCampaignKeywordKey=function(dj){bF=w(dj)?[dj]:dj};this.discardHashTag=function(dj){bO=dj};this.setCookieNamePrefix=function(dj){bj=dj;
aQ=bW()};this.setCookieDomain=function(dj){var dk=L(dj);if(bv(dk)){cX=dk;bh()}};this.getCookieDomain=function(){return cX};this.hasCookies=function(){return"1"===b4()};this.setSessionCookie=function(dl,dk,dj){if(!dl){throw new Error("Missing cookie name")}if(!J(dj)){dj=co}bt.push(dl);de(aT(dl),dk,dj,bo,cX)};this.getCookie=function(dk){var dj=aC(aT(dk));if(dj===0){return null}return dj};this.setCookiePath=function(dj){bo=dj;bh()};this.getCookiePath=function(dj){return bo};this.setVisitorCookieTimeout=function(dj){cI=dj*1000};this.setSessionCookieTimeout=function(dj){co=dj*1000};this.getSessionCookieTimeout=function(){return co};this.setReferralCookieTimeout=function(dj){c5=dj*1000};this.setConversionAttributionFirstReferrer=function(dj){bu=dj};this.setSecureCookie=function(dj){bR=dj};this.disableCookies=function(){bk=true;c8.cookie="0";if(b5){aE()}};this.deleteCookies=function(){aE()};this.setDoNotTrack=function(dk){var dj=h.doNotTrack||h.msDoNotTrack;cP=dk&&(dj==="yes"||dj==="1");if(cP){this.disableCookies()
-}};this.alwaysUseSendBeacon=function(){cW=true};this.addListener=function(dk,dj){aq(dk,dj)};this.enableLinkTracking=function(dk){c9=true;var dj=this;cg(function(){q(function(){bC(dk,dj)})})};this.enableJSErrorTracking=function(){if(cS){return}cS=true;var dj=T.onerror;T.onerror=function(dp,dm,dl,dn,dk){cg(function(){var dq="JavaScript Errors";var dr=dm+":"+dl;if(dn){dr+=":"+dn}at(dq,dr,dp)});if(dj){return dj(dp,dm,dl,dn,dk)}return false}};this.disablePerformanceTracking=function(){a2=false};this.setGenerationTimeMs=function(dj){cm=parseInt(dj,10)};this.setVisitStandardLength=function(dj){dj=Math.max(dj,5);c7=dj};this.enableHeartBeatTimer=function(dj){dj=Math.max(dj,5);a5=(dj||15)*1000;if(cY!==null){dg()}};this.disableHeartBeatTimer=function(){bJ();if(a5||aN){if(T.removeEventListener){T.removeEventListener("focus",ba);T.removeEventListener("blur",ay)}else{if(T.detachEvent){T.detachEvent("onfocus",ba);T.detachEvent("onblur",ay)}}}a5=null;aN=false};this.killFrame=function(){if(T.location!==T.top.location){T.top.location=T.location
+}};this.alwaysUseSendBeacon=function(){cW=true};this.addListener=function(dk,dj){aq(dk,dj)};this.enableLinkTracking=function(dk){c9=true;var dj=this;cg(function(){q(function(){bC(dk,dj)});n(function(){bC(dk,dj)})})};this.enableJSErrorTracking=function(){if(cS){return}cS=true;var dj=T.onerror;T.onerror=function(dp,dm,dl,dn,dk){cg(function(){var dq="JavaScript Errors";var dr=dm+":"+dl;if(dn){dr+=":"+dn}at(dq,dr,dp)});if(dj){return dj(dp,dm,dl,dn,dk)}return false}};this.disablePerformanceTracking=function(){a2=false};this.setGenerationTimeMs=function(dj){cm=parseInt(dj,10)};this.setVisitStandardLength=function(dj){dj=Math.max(dj,5);c7=dj};this.enableHeartBeatTimer=function(dj){dj=Math.max(dj,5);a5=(dj||15)*1000;if(cY!==null){dg()}};this.disableHeartBeatTimer=function(){bJ();if(a5||aN){if(T.removeEventListener){T.removeEventListener("focus",ba);T.removeEventListener("blur",ay)}else{if(T.detachEvent){T.detachEvent("onfocus",ba);T.detachEvent("onblur",ay)}}}a5=null;aN=false};this.killFrame=function(){if(T.location!==T.top.location){T.top.location=T.location
}};this.redirectFile=function(dj){if(T.location.protocol==="file:"){T.location=dj}};this.setCountPreRendered=function(dj){be=dj};this.trackGoal=function(dj,dm,dl,dk){cg(function(){cT(dj,dm,dl,dk)})};this.trackLink=function(dk,dj,dm,dl){cg(function(){c1(dk,dj,dm,dl)})};this.getNumTrackedPageViews=function(){return cr};this.trackPageView=function(dj,dl,dk){b9=[];cJ=[];if(N(b5)){cg(function(){Z(aD,bG,b5)})}else{cg(function(){cr++;bZ(dj,dl,dk)})}};this.trackAllContentImpressions=function(){if(N(b5)){return}cg(function(){q(function(){var dj=v.findContentNodes();var dk=cy(dj);bB.pushMultiple(dk)})})};this.trackVisibleContentImpressions=function(dj,dk){if(N(b5)){return}if(!J(dj)){dj=true}if(!J(dk)){dk=750}aS(dj,dk,this);cg(function(){n(function(){var dl=v.findContentNodes();var dm=a9(dl);bB.pushMultiple(dm)})})};this.trackContentImpression=function(dl,dj,dk){if(N(b5)){return}dl=a(dl);dj=a(dj);dk=a(dk);if(!dl){return}dj=dj||"Unknown";cg(function(){var dm=aF(dl,dj,dk);bB.push(dm)})};this.trackContentImpressionsWithinNode=function(dj){if(N(b5)||!dj){return
}cg(function(){if(ce){n(function(){var dk=v.findContentNodesWithinNode(dj);var dl=a9(dk);bB.pushMultiple(dl)})}else{q(function(){var dk=v.findContentNodesWithinNode(dj);var dl=cy(dk);bB.pushMultiple(dl)})}})};this.trackContentInteraction=function(dl,dm,dj,dk){if(N(b5)){return}dl=a(dl);dm=a(dm);dj=a(dj);dk=a(dk);if(!dl||!dm){return}dj=dj||"Unknown";cg(function(){var dn=aP(dl,dm,dj,dk);if(dn){bB.push(dn)}})};this.trackContentInteractionNode=function(dk,dj){if(N(b5)||!dk){return}cg(function(){var dl=db(dk,dj);if(dl){bB.push(dl)}})};this.logAllContentBlocksOnPage=function(){var dl=v.findContentNodes();var dj=v.collectContent(dl);var dk=typeof console;if(dk!=="undefined"&&console&&console.log){console.log(dj)}};this.trackEvent=function(dk,dm,dj,dl,dp,dn){cg(function(){at(dk,dm,dj,dl,dp,dn)})};this.trackSiteSearch=function(dj,dl,dk,dm){b9=[];cg(function(){b7(dj,dl,dk,dm)})};this.setEcommerceView=function(dm,dj,dl,dk){if(Y(dl)){dl=String(dl)}if(!J(dl)||dl===null||dl===false||!dl.length){dl=""}else{if(dl instanceof Array){dl=JSON_PIWIK.stringify(dl)
}}bV[5]=["_pkc",dl];if(J(dk)&&dk!==null&&dk!==false&&String(dk).length){bV[2]=["_pkp",dk]}if(!Y(dm)&&!Y(dj)){return}if(Y(dm)){bV[3]=["_pks",dm]}if(!Y(dj)){dj=""}bV[4]=["_pkn",dj]};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(c0))};this.addEcommerceItem=function(dn,dj,dl,dk,dm){if(Y(dn)){c0[dn]=[String(dn),dj,dl,dk,dm]}};this.removeEcommerceItem=function(dj){if(Y(dj)){dj=String(dj);delete c0[dj]}};this.clearEcommerceCart=function(){c0={}};this.trackEcommerceOrder=function(dj,dn,dm,dl,dk,dp){bY(dj,dn,dm,dl,dk,dp)};this.trackEcommerceCartUpdate=function(dj){br(dj)};this.trackRequest=function(dk,dm,dl,dj){cg(function(){var dn=cs(dk,dm,dj);bE(dn,bI,dl)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bB.enabled=false};this.setRequestQueueInterval=function(dj){if(dj<1000){throw new Error("Request queue interval needs to be at least 1000ms")}bB.interval=dj};this.queueRequest=function(dj){cg(function(){var dk=cs(dj);