From de5ae85e7a11f7bbd962256c890a32188c40d000 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Fri, 26 Jun 2020 06:17:54 -0700 Subject: Track seconds instead of days for "days since" dimensions (#15774) * Modify dimensions and add tests. * unfinished debugging commit * changes to fix test, remove tracker code, add update code * fix some tests * fix migration issue * fixing some tests * fix some bugs, update some expected test files, remove _idvc from some tests * start replacing _ects * Finish seconds since last ecommerce order change. * fix couple issues * fix a couple tests * fix some more tests * fixing a couple more tests * apply review feedback * unfinished commit * add back dimensions = * fixing tests & removing some code * fix some bugs + tests and remove debugging code * fixing some tests and issues * Some debugging code for the tracker in case of exceptions. * debug and fix another issue when tracking visits in the past * fix test * update JS and fix several tests * Fixing more tests. * Add missing files. * update expected test files * Add some unit tests. * update more expected files * update more test files * update more test files * update changelog and remove _ects query param * apply review feedback * fix merge issue * clearer code * fix migration issue * update expected files * update expected files again * updating tests * fix test * rebuilt piwik.js * unify previous visitor properties / original visit row approach * fixing some tests * Add new column version entries into the option table. * try undoing 1.5 update change * apply review feedback * remove more unused cookie values * rebuilt piwik.js * Fix test count. * update test files * rebuilt piwik.js * removel log analytics submodule update * update submodule * update some expected screenshots * Fix versions in omnifixture since we were probably adding to the beta update after it changed. * update screenshots --- js/README.md | 2 +- js/piwik.js | 66 ++++++++------------------------------------------------- js/piwik.min.js | 60 +++++++++++++++++++++++++-------------------------- 3 files changed, 40 insertions(+), 88 deletions(-) (limited to 'js') diff --git a/js/README.md b/js/README.md index b73ae1d2b0..85aa052cfa 100644 --- a/js/README.md +++ b/js/README.md @@ -52,7 +52,7 @@ The js/ folder contains: We recommend to execute this command under Linux. It has not been tested with Windows and MacOS might add a trailing newline which fails tests. - +VisitorGeolocatorTest * In a production environment, the tests/javascript folder is not used and can be removed (if present). diff --git a/js/piwik.js b/js/piwik.js index f4e61e02e8..d15eac4b1b 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -105,7 +105,7 @@ isNodeAuthorizedToTriggerInteraction, getConfigDownloadExtensions, disableLinkTracking, substr, setAnyAttribute, max, abs, childNodes, compareDocumentPosition, body, getConfigVisitorCookieTimeout, getRemainingVisitorCookieTimeout, getDomains, getConfigCookiePath, - getConfigIdPageView, newVisitor, uuid, createTs, visitCount, currentVisitTs, lastVisitTs, lastEcommerceOrderTs, + getConfigIdPageView, newVisitor, uuid, createTs, currentVisitTs, "", "\b", "\t", "\n", "\f", "\r", "\"", "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, parse, prototype, push, replace, sort, slice, stringify, test, toJSON, toString, valueOf, objectToJSON, addTracker, removeAllAsyncTrackersButFirst, @@ -3308,19 +3308,7 @@ if (typeof window.Matomo !== 'object') { uuid, // creation timestamp - seconds since Unix epoch - nowTs, - - // visitCount - 0 = no previous visit - 0, - - // current visit timestamp - nowTs, - - // last visit timestamp - blank = no previous visit - '', - - // last ecommerce order timestamp - '' + nowTs ]; return cookieValue; @@ -3334,26 +3322,12 @@ if (typeof window.Matomo !== 'object') { var cookieVisitorIdValue = loadVisitorIdCookie(), newVisitor = cookieVisitorIdValue[0], uuid = cookieVisitorIdValue[1], - createTs = cookieVisitorIdValue[2], - visitCount = cookieVisitorIdValue[3], - currentVisitTs = cookieVisitorIdValue[4], - lastVisitTs = cookieVisitorIdValue[5]; - - // case migrating from pre-1.5 cookies - if (!isDefined(cookieVisitorIdValue[6])) { - cookieVisitorIdValue[6] = ""; - } - - var lastEcommerceOrderTs = cookieVisitorIdValue[6]; + createTs = cookieVisitorIdValue[2]; return { newVisitor: newVisitor, uuid: uuid, - createTs: createTs, - visitCount: visitCount, - currentVisitTs: currentVisitTs, - lastVisitTs: lastVisitTs, - lastEcommerceOrderTs: lastEcommerceOrderTs + createTs: createTs }; } @@ -3385,11 +3359,7 @@ if (typeof window.Matomo !== 'object') { } var cookieValue = visitorIdCookieValues.uuid + '.' + - visitorIdCookieValues.createTs + '.' + - visitorIdCookieValues.visitCount + '.' + - nowTs + '.' + - visitorIdCookieValues.lastVisitTs + '.' + - visitorIdCookieValues.lastEcommerceOrderTs; + visitorIdCookieValues.createTs + '.'; setCookie(getCookieName('id'), cookieValue, getRemainingVisitorCookieTimeout(), configCookiePath, configCookieDomain, configCookieIsSecure); } @@ -3551,7 +3521,7 @@ if (typeof window.Matomo !== 'object') { * with the standard parameters (plugins, resolution, url, referrer, etc.). * Sends the pageview and browser settings with every request in case of race conditions. */ - function getRequest(request, customData, pluginMethod, currentEcommerceOrderTs) { + function getRequest(request, customData, pluginMethod) { var i, now = new Date(), nowTs = Math.round(now.getTime() / 1000), @@ -3579,9 +3549,6 @@ if (typeof window.Matomo !== 'object') { } var cookieVisitorIdValues = getValuesFromVisitorIdCookie(); - if (!isDefined(currentEcommerceOrderTs)) { - currentEcommerceOrderTs = ""; - } // send charset if document charset is not utf-8. sometimes encoding // of urls will be the same as this and not utf-8, which will cause problems @@ -3600,16 +3567,6 @@ if (typeof window.Matomo !== 'object') { if (!cookieSessionValue) { // cookie 'ses' was not found: we consider this the start of a 'session' - // here we make sure that if 'ses' cookie is deleted few times within the visit - // and so this code path is triggered many times for one visit, - // we only increase visitCount once per Visit window (default 30min) - var visitDuration = configSessionCookieTimeout / 1000; - if (!cookieVisitorIdValues.lastVisitTs - || (nowTs - cookieVisitorIdValues.lastVisitTs) > visitDuration) { - cookieVisitorIdValues.visitCount++; - cookieVisitorIdValues.lastVisitTs = cookieVisitorIdValues.currentVisitTs; - } - // Detect the campaign information from the current URL // Only if campaign wasn't previously set @@ -3674,13 +3631,12 @@ if (typeof window.Matomo !== 'object') { '&url=' + encodeWrapper(purify(currentUrl)) + (configReferrerUrl.length ? '&urlref=' + encodeWrapper(purify(configReferrerUrl)) : '') + ((configUserId && configUserId.length) ? '&uid=' + encodeWrapper(configUserId) : '') + - '&_id=' + cookieVisitorIdValues.uuid + '&_idts=' + cookieVisitorIdValues.createTs + '&_idvc=' + cookieVisitorIdValues.visitCount + + '&_id=' + cookieVisitorIdValues.uuid + + '&_idn=' + cookieVisitorIdValues.newVisitor + // currently unused (campaignNameDetected.length ? '&_rcn=' + encodeWrapper(campaignNameDetected) : '') + (campaignKeywordDetected.length ? '&_rck=' + encodeWrapper(campaignKeywordDetected) : '') + '&_refts=' + referralTs + - '&_viewts=' + cookieVisitorIdValues.lastVisitTs + - (String(cookieVisitorIdValues.lastEcommerceOrderTs).length ? '&_ects=' + cookieVisitorIdValues.lastEcommerceOrderTs : '') + (String(referralUrl).length ? '&_ref=' + encodeWrapper(purify(referralUrl.slice(0, referralUrlMaxLength))) : '') + (charSet ? '&cs=' + encodeWrapper(charSet) : '') + '&send_image=0'; @@ -3779,7 +3735,6 @@ if (typeof window.Matomo !== 'object') { } // update cookies - cookieVisitorIdValues.lastEcommerceOrderTs = isDefined(currentEcommerceOrderTs) && String(currentEcommerceOrderTs).length ? currentEcommerceOrderTs : cookieVisitorIdValues.lastEcommerceOrderTs; setVisitorIdCookie(cookieVisitorIdValues); setSessionCookie(); @@ -3825,7 +3780,6 @@ if (typeof window.Matomo !== 'object') { function logEcommerce(orderId, grandTotal, subTotal, tax, shipping, discount) { var request = 'idgoal=0', - lastEcommerceOrderTs, now = new Date(), items = [], sku, @@ -3833,8 +3787,6 @@ if (typeof window.Matomo !== 'object') { if (isEcommerceOrder) { request += '&ec_id=' + encodeWrapper(orderId); - // Record date of order in the visitor cookie - lastEcommerceOrderTs = Math.round(now.getTime() / 1000); } request += '&revenue=' + grandTotal; @@ -3885,7 +3837,7 @@ if (typeof window.Matomo !== 'object') { } request += '&ec_items=' + encodeWrapper(windowAlias.JSON.stringify(items)); } - request = getRequest(request, configCustomData, 'ecommerce', lastEcommerceOrderTs); + request = getRequest(request, configCustomData, 'ecommerce'); sendRequest(request, configTrackerPause); if (isEcommerceOrder) { diff --git a/js/piwik.min.js b/js/piwik.min.js index 91d9777847..ceac1f78db 100644 --- a/js/piwik.min.js +++ b/js/piwik.min.js @@ -37,35 +37,35 @@ dn.open("POST",aD,true);dn.onreadystatechange=function(){if(this.readyState===4& return !cy||(dj-cy)>a4}function ay(){if(dd()){bR()}bK()}function dg(){if(aM||!a4){return}aM=true;an(S,"focus",a9);an(S,"blur",ay);ab++;t.addPlugin("HeartBeat"+ab,{unload:function(){if(aM&&dd()){bR()}}})}function cD(dn){var dk=new Date();var dj=dk.getTime();cY=dj;if(cC&&dj=dj.length){return[dj]}var dk=0;var dl=dj.length;var dm=[];for(dk;dk=dk&&dj<=(dk+aY)){return true}}return false}function dh(dj){if(!cN){return""}var dn=e(dj,av);if(!dn){return""}dn=String(dn);var dl=new RegExp("^[a-zA-Z0-9]+$"); -if(dn.length===32&&dl.test(dn)){var dk=dn.substr(16,32);if(c2(dk)){var dm=dn.substr(0,16);return dm}}return""}function cO(){if(!bO){bO=dh(bN)}var dl=new Date(),dj=Math.round(dl.getTime()/1000),dk=aS("id"),dp=aC(dk),dn,dm;if(dp){dn=dp.split(".");dn.unshift("0");if(bO.length){dn[1]=bO}return dn}if(bO.length){dm=bO}else{if("0"===b5()){dm=""}else{dm=cR()}}dn=["1",dm,dj,0,dj,"",""];return dn}function aX(){var dr=cO(),dm=dr[0],dn=dr[1],dk=dr[2],dj=dr[3],dp=dr[4],dl=dr[5];if(!J(dr[6])){dr[6]=""}var dq=dr[6];return{newVisitor:dm,uuid:dn,createTs:dk,visitCount:dj,currentVisitTs:dp,lastVisitTs:dl,lastEcommerceOrderTs:dq}}function aG(){var dm=new Date(),dk=dm.getTime(),dn=aX().createTs;var dj=parseInt(dn,10);var dl=(dj*1000)+cK-dk;return dl}function aL(dj){if(!b6){return}var dl=new Date(),dk=Math.round(dl.getTime()/1000);if(!J(dj)){dj=aX()}var dm=dj.uuid+"."+dj.createTs+"."+dj.visitCount+"."+dk+"."+dj.lastVisitTs+"."+dj.lastEcommerceOrderTs;de(aS("id"),dm,aG(),bp,cX,bS)}function bM(){var dj=aC(aS("ref")); -if(dj.length){try{dj=S.JSON.parse(dj);if(V(dj)){return dj}}catch(dk){}}return["","",0,""]}function bw(dk){var dj="testvalue";de("test",dj,10000,null,dk);if(aC("test")===dj){bY("test",null,dk);return true}return false}function aE(){var dk=bl;bl=false;var dj,dl;for(dj=0;djdJ){dA.visitCount++;dA.lastVisitTs=dA.currentVisitTs}if(!bv||!ds.length){for(dG in cq){if(Object.prototype.hasOwnProperty.call(cq,dG)){ds=e(dK,cq[dG]); -if(ds.length){break}}}for(dG in bG){if(Object.prototype.hasOwnProperty.call(bG,dG)){dj=e(dK,bG[dG]);if(dj.length){break}}}}dO=d(bn);dv=dF.length?d(dF):"";if(dO.length&&!aU(dO)&&(!bv||!dv.length||aU(dv))){dF=bn}if(dF.length||ds.length){dr=du;dE=[ds,dj,dr,b2(dF.slice(0,dn))];de(dB,S.JSON.stringify(dE),c5,bp,cX,bS)}}dl+="&idsite="+b6+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+dk.getHours()+"&m="+dk.getMinutes()+"&s="+dk.getSeconds()+"&url="+s(b2(dK))+(bn.length?"&urlref="+s(b2(bn)):"")+((by&&by.length)?"&uid="+s(by):"")+"&_id="+dA.uuid+"&_idts="+dA.createTs+"&_idvc="+dA.visitCount+"&_idn="+dA.newVisitor+(ds.length?"&_rcn="+s(ds):"")+(dj.length?"&_rck="+s(dj):"")+"&_refts="+dr+"&_viewts="+dA.lastVisitTs+(String(dA.lastEcommerceOrderTs).length?"&_ects="+dA.lastEcommerceOrderTs:"")+(String(dF).length?"&_ref="+s(b2(dF.slice(0,dn))):"")+(dx?"&cs="+s(dx):"")+"&send_image=0";var dN=cI();for(dG in dN){if(Object.prototype.hasOwnProperty.call(dN,dG)){dl+="&"+dG+"="+dN[dG]}}var dM=[];if(dH){for(dG in dH){if(Object.prototype.hasOwnProperty.call(dH,dG)&&/^dimension\d+$/.test(dG)){var dq=dG.replace("dimension",""); -dM.push(parseInt(dq,10));dM.push(String(dq));dl+="&"+dG+"="+s(dH[dG]);delete dH[dG]}}}if(dH&&B(dH)){dH=null}for(dG in ct){if(Object.prototype.hasOwnProperty.call(ct,dG)){dl+="&"+dG+"="+s(ct[dG])}}for(dG in bm){if(Object.prototype.hasOwnProperty.call(bm,dG)){var dw=(-1===M(dM,dG));if(dw){dl+="&dimension"+dG+"="+s(bm[dG])}}}if(dH){dl+="&data="+s(S.JSON.stringify(dH))}else{if(ao){dl+="&data="+s(S.JSON.stringify(ao))}}function dt(dP,dQ){var dR=S.JSON.stringify(dP);if(dR.length>2){return"&"+dQ+"="+s(dR)}return""}var dL=di(bW);var dC=di(cm);dl+=dt(dL,"cvar");dl+=dt(dC,"e_cvar");if(aP){dl+=dt(aP,"_cvar");for(dG in dD){if(Object.prototype.hasOwnProperty.call(dD,dG)){if(aP[dG][0]===""||aP[dG][1]===""){delete aP[dG]}}}if(bQ){de(dy,S.JSON.stringify(aP),co,bp,cX,bS)}}if(a1&&bE&&!bg){dl=az(dl);bg=true}if(aK){dl+="&pv_id="+aK}dA.lastEcommerceOrderTs=J(dm)&&String(dm).length?dm:dA.lastEcommerceOrderTs;aL(dA);cd();dl+=ac(dI,{tracker:bI,request:dl});if(cZ.length){dl+="&"+cZ}if(A(cb)){dl=cb(dl)}return dl -}bR=function a6(){var dj=new Date();dj=dj.getTime();if(!cY){return false}if((cY+(1000*c7))<=dj){return false}if(cY+a4<=dj){bI.ping();return true}return false};function bq(dm,dl,ds,dn,dj,dv){var dq="idgoal=0",dr,dk=new Date(),dt=[],du,dp=String(dm).length;if(dp){dq+="&ec_id="+s(dm);dr=Math.round(dk.getTime()/1000)}dq+="&revenue="+dl;if(String(ds).length){dq+="&ec_st="+ds}if(String(dn).length){dq+="&ec_tx="+dn}if(String(dj).length){dq+="&ec_sh="+dj}if(String(dv).length){dq+="&ec_dt="+dv}if(c0){for(du in c0){if(Object.prototype.hasOwnProperty.call(c0,du)){if(!J(c0[du][1])){c0[du][1]=""}if(!J(c0[du][2])){c0[du][2]=""}if(!J(c0[du][3])||String(c0[du][3]).length===0){c0[du][3]=0}if(!J(c0[du][4])||String(c0[du][4]).length===0){c0[du][4]=1}dt.push(c0[du])}}dq+="&ec_items="+s(S.JSON.stringify(dt))}dq=cs(dq,ao,"ecommerce",dr);bF(dq,bJ);if(dp){c0={}}}function bZ(dj,dn,dm,dl,dk,dp){if(String(dj).length&&J(dn)){bq(dj,dn,dm,dl,dk,dp)}}function bs(dj){if(J(dj)){bq("",dj,"","","","")}}function b0(dk,dm,dl){aK=bf(); -var dj=cs("action_name="+s(al(dk||bi)),dm,"log");if(!bg){dj=az(dj)}bF(dj,bJ,dl)}function aZ(dl,dk){var dm,dj="(^| )(piwik[_-]"+dk+"|matomo[_-]"+dk;if(dl){for(dm=0;dm0){dn=parseInt(dn,10);dr(dn)}})}var bC={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dj=this.requests;this.requests=[];if(dj.length===1){bF(dj[0],bJ)}else{df(dj,bJ)}},canQueue:function(){return !l&&this.enabled},pushMultiple:function(dk){if(!this.canQueue()){df(dk,bJ);return}var dj;for(dj=0;dj0){if(!J(dk)){dk=""}if(!w(dk)){dk=String(dk)}bm[dj]=dk}};this.getCustomDimension=function(dj){dj=parseInt(dj,10);if(dj>0&&Object.prototype.hasOwnProperty.call(bm,dj)){return bm[dj]}};this.deleteCustomDimension=function(dj){dj=parseInt(dj,10);if(dj>0){delete bm[dj]}};this.setCustomVariable=function(dk,dj,dn,dl){var dm;if(!J(dl)){dl="visit"}if(!J(dj)){return}if(!J(dn)){dn=""}if(dk>0){dj=!w(dj)?String(dj):dj;dn=!w(dn)?String(dn):dn;dm=[dj.slice(0,bt),dn.slice(0,bt)];if(dl==="visit"||dl===2){cF();aP[dk]=dm}else{if(dl==="page"||dl===3){bW[dk]=dm}else{if(dl==="event"){cm[dk]=dm}}}}};this.getCustomVariable=function(dk,dl){var dj;if(!J(dl)){dl="visit"}if(dl==="page"||dl===3){dj=bW[dk]}else{if(dl==="event"){dj=cm[dk]}else{if(dl==="visit"||dl===2){cF();dj=aP[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){bW={} -}else{if(dj==="event"){cm={}}else{if(dj==="visit"||dj===2){aP={}}}}};this.storeCustomVariablesInCookie=function(){bQ=true};this.setLinkTrackingTimer=function(dj){bJ=dj};this.getLinkTrackingTimer=function(){return bJ};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;dj1&&ap!=="addTracker"){ak("The method "+ap+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}av[ap]++}}}}return au}var C=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","alwaysUseSendBeacon","enableLinkTracking","requireConsent","setConsentGiven"];function ad(aq,ap){var ao=new P(aq,ap);I.push(ao);_paq=c(_paq,C);for(E=0;E<_paq.length;E++){if(_paq[E]){af(_paq[E])}}_paq=new H();t.trigger("TrackerAdded",[ao]);return ao}an(S,"beforeunload",ai,false);an(S,"message",function(au){if(!au||!au.origin){return}var aw,ar,ap;var ax=d(au.origin); -var at=t.getAsyncTrackers();for(ar=0;ar0){dn=parseInt(dn,10);dr(dn)}})}var bC={enabled:true,requests:[],timeout:null,interval:2500,sendRequests:function(){var dj=this.requests;this.requests=[];if(dj.length===1){bF(dj[0],bJ)}else{df(dj,bJ)}},canQueue:function(){return !l&&this.enabled},pushMultiple:function(dk){if(!this.canQueue()){df(dk,bJ);return}var dj;for(dj=0;dj0){if(!J(dk)){dk=""}if(!w(dk)){dk=String(dk)}bm[dj]=dk}};this.getCustomDimension=function(dj){dj=parseInt(dj,10);if(dj>0&&Object.prototype.hasOwnProperty.call(bm,dj)){return bm[dj]}};this.deleteCustomDimension=function(dj){dj=parseInt(dj,10);if(dj>0){delete bm[dj]}};this.setCustomVariable=function(dk,dj,dn,dl){var dm;if(!J(dl)){dl="visit"}if(!J(dj)){return}if(!J(dn)){dn="" +}if(dk>0){dj=!w(dj)?String(dj):dj;dn=!w(dn)?String(dn):dn;dm=[dj.slice(0,bt),dn.slice(0,bt)];if(dl==="visit"||dl===2){cF();aP[dk]=dm}else{if(dl==="page"||dl===3){bW[dk]=dm}else{if(dl==="event"){cm[dk]=dm}}}}};this.getCustomVariable=function(dk,dl){var dj;if(!J(dl)){dl="visit"}if(dl==="page"||dl===3){dj=bW[dk]}else{if(dl==="event"){dj=cm[dk]}else{if(dl==="visit"||dl===2){cF();dj=aP[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){bW={}}else{if(dj==="event"){cm={}}else{if(dj==="visit"||dj===2){aP={}}}}};this.storeCustomVariablesInCookie=function(){bQ=true};this.setLinkTrackingTimer=function(dj){bJ=dj};this.getLinkTrackingTimer=function(){return bJ};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;dj1&&ap!=="addTracker"){ak("The method "+ap+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers') +}av[ap]++}}}}return au}var C=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","alwaysUseSendBeacon","enableLinkTracking","requireConsent","setConsentGiven"];function ad(aq,ap){var ao=new P(aq,ap);I.push(ao);_paq=c(_paq,C);for(E=0;E<_paq.length;E++){if(_paq[E]){af(_paq[E])}}_paq=new H();t.trigger("TrackerAdded",[ao]);return ao}an(S,"beforeunload",ai,false);an(S,"message",function(au){if(!au||!au.origin){return}var aw,ar,ap;var ax=d(au.origin);var at=t.getAsyncTrackers();for(ar=0;ar