You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/priv/tracker/js/plausible.compat.hash.js

1 line
1.2 KiB
JavaScript

!function(){"use strict";var e,t,i,a=window.location,o=window.document,n=window.localStorage,r=o.getElementById("plausible"),l=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=n&&n.plausible_ignore;function d(e){console.warn("Ignoring Event: "+e)}function w(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(a.hostname)||"file:"===a.protocol)return d("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){if("true"==s)return d("localStorage flag");var i={};i.n=e,i.u=a.href,i.d=r.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 n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(i)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var p=window.plausible&&window.plausible.q||[];window.plausible=w;for(var c,u=0;u<p.length;u++)w.apply(this,p[u]);function g(){c=a.pathname,w("pageview")}window.addEventListener("hashchange",g),"prerender"===o.visibilityState?o.addEventListener("visibilitychange",function(){c||"visible"!==o.visibilityState||g()}):g()}();