analytics/priv/tracker/js/plausible.exclusions.hash.local.manual.js
2021-10-10 13:07:37 +02:00

1 line
1.1 KiB
JavaScript

!function(){"use strict";var r=window.location,o=window.document,e=window.localStorage,l=o.currentScript,w=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",p=e&&e.plausible_ignore,d=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function t(e,t){if(!(window.phantom||window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){if("true"==p)return s("localStorage flag");if(d)for(var n=0;n<d.length;n++)if("pageview"==e&&r.pathname.match(new RegExp("^"+d[n].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var i={};i.n=e,i.u=r.href,i.d=l.getAttribute("data-domain"),i.r=o.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props)),i.h=1;var a=new XMLHttpRequest;a.open("POST",w,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}var n=window.plausible&&window.plausible.q||[];window.plausible=t;for(var i=0;i<n.length;i++)t.apply(this,n[i])}();