mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
199206babc
* added the first version of dimensions extension * finished dimensions script extension + updated tracking to use it * script variants build
1 line
876 B
JavaScript
1 line
876 B
JavaScript
!function(){"use strict";var a=window.location,r=window.document,o=r.currentScript,w=o.getAttribute("data-api")||new URL(o.src).origin+"/api/event";function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"===window.localStorage.plausible_ignore)return void console.warn("Ignoring Event: localStorage flag")}catch(e){}var n={};n.n=e,n.u=t&&t.u?t.u:a.href,n.d=o.getAttribute("data-domain"),n.r=r.referrer||null,n.w=window.innerWidth,t&&t.meta&&(n.m=JSON.stringify(t.meta)),t&&t.props&&(n.p=t.props),n.h=1;var i=new XMLHttpRequest;i.open("POST",w,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(n)),i.onreadystatechange=function(){4===i.readyState&&t&&t.callback&&t.callback()}}}var t=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n=0;n<t.length;n++)e.apply(this,t[n])}(); |