From 8616dd46fbef568cab38a0f55197bd6e4acce56d Mon Sep 17 00:00:00 2001 From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:52:09 +0300 Subject: [PATCH] added file-downloads script extension (#1775) * added file-downloads script extension * fixed the issues and made it compatible with IE * changelog update --- CHANGELOG.md | 1 + lib/plausible_web/plugs/tracker.ex | 11 +++- ...e.compat.exclusions.file-downloads.hash.js | 1 + ...at.exclusions.file-downloads.hash.local.js | 1 + ...usions.file-downloads.hash.local.manual.js | 1 + ...nloads.hash.local.manual.outbound-links.js | 1 + ...ile-downloads.hash.local.outbound-links.js | 1 + ...t.exclusions.file-downloads.hash.manual.js | 1 + ...le-downloads.hash.manual.outbound-links.js | 1 + ...ions.file-downloads.hash.outbound-links.js | 1 + ...usible.compat.exclusions.file-downloads.js | 1 + ....compat.exclusions.file-downloads.local.js | 1 + ....exclusions.file-downloads.local.manual.js | 1 + ...e-downloads.local.manual.outbound-links.js | 1 + ...ons.file-downloads.local.outbound-links.js | 1 + ...compat.exclusions.file-downloads.manual.js | 1 + ...ns.file-downloads.manual.outbound-links.js | 1 + ...xclusions.file-downloads.outbound-links.js | 1 + .../plausible.compat.file-downloads.hash.js | 1 + ...usible.compat.file-downloads.hash.local.js | 1 + ...compat.file-downloads.hash.local.manual.js | 1 + ...nloads.hash.local.manual.outbound-links.js | 1 + ...ile-downloads.hash.local.outbound-links.js | 1 + ...sible.compat.file-downloads.hash.manual.js | 1 + ...le-downloads.hash.manual.outbound-links.js | 1 + ...mpat.file-downloads.hash.outbound-links.js | 1 + .../js/plausible.compat.file-downloads.js | 1 + .../plausible.compat.file-downloads.local.js | 1 + ...ible.compat.file-downloads.local.manual.js | 1 + ...e-downloads.local.manual.outbound-links.js | 1 + ...pat.file-downloads.local.outbound-links.js | 1 + .../plausible.compat.file-downloads.manual.js | 1 + ...at.file-downloads.manual.outbound-links.js | 1 + ...le.compat.file-downloads.outbound-links.js | 1 + ...lausible.exclusions.file-downloads.hash.js | 1 + ...le.exclusions.file-downloads.hash.local.js | 1 + ...usions.file-downloads.hash.local.manual.js | 1 + ...nloads.hash.local.manual.outbound-links.js | 1 + ...ile-downloads.hash.local.outbound-links.js | 1 + ...e.exclusions.file-downloads.hash.manual.js | 1 + ...le-downloads.hash.manual.outbound-links.js | 1 + ...ions.file-downloads.hash.outbound-links.js | 1 + .../js/plausible.exclusions.file-downloads.js | 1 + ...ausible.exclusions.file-downloads.local.js | 1 + ....exclusions.file-downloads.local.manual.js | 1 + ...e-downloads.local.manual.outbound-links.js | 1 + ...ons.file-downloads.local.outbound-links.js | 1 + ...usible.exclusions.file-downloads.manual.js | 1 + ...ns.file-downloads.manual.outbound-links.js | 1 + ...xclusions.file-downloads.outbound-links.js | 1 + .../js/plausible.file-downloads.hash.js | 1 + .../js/plausible.file-downloads.hash.local.js | 1 + ...usible.file-downloads.hash.local.manual.js | 1 + ...nloads.hash.local.manual.outbound-links.js | 1 + ...ile-downloads.hash.local.outbound-links.js | 1 + .../plausible.file-downloads.hash.manual.js | 1 + ...le-downloads.hash.manual.outbound-links.js | 1 + ...ible.file-downloads.hash.outbound-links.js | 1 + priv/tracker/js/plausible.file-downloads.js | 1 + .../js/plausible.file-downloads.local.js | 1 + .../plausible.file-downloads.local.manual.js | 1 + ...e-downloads.local.manual.outbound-links.js | 1 + ...ble.file-downloads.local.outbound-links.js | 1 + .../js/plausible.file-downloads.manual.js | 1 + ...le.file-downloads.manual.outbound-links.js | 1 + ...plausible.file-downloads.outbound-links.js | 1 + tracker/compile.js | 2 +- tracker/src/plausible.js | 55 +++++++++++++++++-- 68 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.local.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.exclusions.file-downloads.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.local.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.manual.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.hash.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.local.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.local.manual.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.manual.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.compat.file-downloads.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.local.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.hash.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.local.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.local.manual.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.manual.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.exclusions.file-downloads.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.local.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.local.manual.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.manual.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.hash.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.js create mode 100644 priv/tracker/js/plausible.file-downloads.local.js create mode 100644 priv/tracker/js/plausible.file-downloads.local.manual.js create mode 100644 priv/tracker/js/plausible.file-downloads.local.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.local.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.manual.js create mode 100644 priv/tracker/js/plausible.file-downloads.manual.outbound-links.js create mode 100644 priv/tracker/js/plausible.file-downloads.outbound-links.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0359bcd8..63ac137d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ## Unreleased ### Added +- A `file-downloads` script extension for automatically tracking file downloads as custom events - Integration with [Matomo's referrer spam list](https://github.com/matomo-org/referrer-spam-list/blob/master/spammers.txt) to block known spammers - API route `PUT /api/v1/sites/goals` with form params `site_id`, `event_name` and/or `page_path`, and `goal_type` with supported types `event` and `page` - API route `DELETE /api/v1/sites/goals/:goal_id` with form params `site_id` diff --git a/lib/plausible_web/plugs/tracker.ex b/lib/plausible_web/plugs/tracker.ex index 71d60327..e64e631d 100644 --- a/lib/plausible_web/plugs/tracker.ex +++ b/lib/plausible_web/plugs/tracker.ex @@ -2,7 +2,16 @@ defmodule PlausibleWeb.Tracker do import Plug.Conn use Agent - base_variants = ["hash", "outbound-links", "exclusions", "compat", "local", "manual"] + base_variants = [ + "hash", + "outbound-links", + "exclusions", + "compat", + "local", + "manual", + "file-downloads" + ] + base_filenames = ["plausible", "script"] # Generates Power Set of all variants diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.js new file mode 100644 index 00000000..ddd3e12c --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,r=window.document,l=r.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=l.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var n=new XMLHttpRequest;n.open("POST",p,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var n=l.getAttribute("file-types"),d=n&&n.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function u(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",u),r.addEventListener("auxclick",u);var w=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,g=0;g<w.length;g++)a.apply(this,w[g]);function h(){f=o.pathname,a("pageview")}window.addEventListener("hashchange",h),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){f||"visible"!==r.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.js new file mode 100644 index 00000000..b8027e7c --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,r=window.document,p=r.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var n=p.getAttribute("file-types"),d=n&&n.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function u(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",u),r.addEventListener("auxclick",u);var w=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,g=0;g<w.length;g++)a.apply(this,w[g]);function v(){f=o.pathname,a("pageview")}window.addEventListener("hashchange",v),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){f||"visible"!==r.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.js new file mode 100644 index 00000000..0ac70a97 --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,p=n.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var a=0;a<s.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=p.getAttribute("data-domain"),i.r=n.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 r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var r=p.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var w=window.plausible&&window.plausible.q||[];window.plausible=i;for(var f=0;f<w.length;f++)i.apply(this,w[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.outbound-links.js new file mode 100644 index 00000000..001afb0b --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var a=0;a<c.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=l.getAttribute("data-domain"),r.r=n.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props)),r.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function i(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var u=l.getAttribute("file-types"),f=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),f.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var g=window.plausible&&window.plausible.q||[];window.plausible=r;for(var w=0;w<g.length;w++)r.apply(this,g[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.outbound-links.js new file mode 100644 index 00000000..ca21560d --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function r(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var d=l.getAttribute("file-types"),u=d&&d.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",f),n.addEventListener("auxclick",f);var g=window.plausible&&window.plausible.q||[];window.plausible=a;for(var h,w=0;w<g.length;w++)a.apply(this,g[w]);function v(){h=o.pathname,a("pageview")}window.addEventListener("hashchange",v),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){h||"visible"!==n.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.js new file mode 100644 index 00000000..937729d4 --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var a=0;a<s.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=l.getAttribute("data-domain"),i.r=n.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 r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var r=l.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var f=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<f.length;w++)i.apply(this,f[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.outbound-links.js new file mode 100644 index 00000000..ac48f15d --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var a=0;a<c.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=l.getAttribute("data-domain"),r.r=n.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props)),r.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function i(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var u=l.getAttribute("file-types"),f=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),f.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var h=window.plausible&&window.plausible.q||[];window.plausible=r;for(var g=0;g<h.length;g++)r.apply(this,h[g])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.outbound-links.js new file mode 100644 index 00000000..e2b15d8f --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.hash.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function r(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var d=l.getAttribute("file-types"),u=d&&d.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",f),n.addEventListener("auxclick",f);var h=window.plausible&&window.plausible.q||[];window.plausible=a;for(var g,w=0;w<h.length;w++)a.apply(this,h[w]);function v(){g=o.pathname,a("pageview")}window.addEventListener("hashchange",v),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){g||"visible"!==n.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.js new file mode 100644 index 00000000..622aa6a0 --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,r=window.document,p=r.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var n=p.getAttribute("file-types"),d=n&&n.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function u(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",u),r.addEventListener("auxclick",u);var w=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,g=0;g<w.length;g++)a.apply(this,w[g]);function h(){f!==o.pathname&&(f=o.pathname,a("pageview"))}var v,m=window.history;m.pushState&&(v=m.pushState,m.pushState=function(){v.apply(this,arguments),h()},window.addEventListener("popstate",h)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){f||"visible"!==r.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.js new file mode 100644 index 00000000..dc2dc0b3 --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,p=window.location,r=window.document,o=r.getElementById("plausible"),l=o.getAttribute("data-api")||(e=o.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=o&&o.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&p.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=p.href,a.d=o.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var n=o.getAttribute("file-types"),d=n&&n.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function u(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){p.href=a.href},150),e.preventDefault()))}r.addEventListener("click",u),r.addEventListener("auxclick",u);var w=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,g=0;g<w.length;g++)a.apply(this,w[g]);function v(){f!==p.pathname&&(f=p.pathname,a("pageview"))}var h,m=window.history;m.pushState&&(h=m.pushState,m.pushState=function(){h.apply(this,arguments),v()},window.addEventListener("popstate",v)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){f||"visible"!==r.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.js new file mode 100644 index 00000000..0636cc7f --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,p=n.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var a=0;a<s.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=p.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var r=p.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var w=window.plausible&&window.plausible.q||[];window.plausible=i;for(var f=0;f<w.length;f++)i.apply(this,w[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.outbound-links.js new file mode 100644 index 00000000..58635a2b --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var a=0;a<c.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=l.getAttribute("data-domain"),r.r=n.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function i(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var u=l.getAttribute("file-types"),f=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),f.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var g=window.plausible&&window.plausible.q||[];window.plausible=r;for(var w=0;w<g.length;w++)r.apply(this,g[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.outbound-links.js new file mode 100644 index 00000000..0df82e05 --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,p=n.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function r(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var u=p.getAttribute("file-types"),d=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",f),n.addEventListener("auxclick",f);var h=window.plausible&&window.plausible.q||[];window.plausible=a;for(var w,g=0;g<h.length;g++)a.apply(this,h[g]);function v(){w!==o.pathname&&(w=o.pathname,a("pageview"))}var m,y=window.history;y.pushState&&(m=y.pushState,y.pushState=function(){m.apply(this,arguments),v()},window.addEventListener("popstate",v)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){w||"visible"!==n.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.js new file mode 100644 index 00000000..637be67b --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var a=0;a<s.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=l.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var r=l.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var f=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<f.length;w++)i.apply(this,f[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.outbound-links.js new file mode 100644 index 00000000..b5b368cc --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,n=window.document,l=n.getElementById("plausible"),p=l.getAttribute("data-api")||(e=l.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event"),c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var a=0;a<c.length;a++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[a].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=l.getAttribute("data-domain"),r.r=n.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function i(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var u=l.getAttribute("file-types"),f=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),f.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var g=window.plausible&&window.plausible.q||[];window.plausible=r;for(var h=0;h<g.length;h++)r.apply(this,g[h])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.exclusions.file-downloads.outbound-links.js b/priv/tracker/js/plausible.compat.exclusions.file-downloads.outbound-links.js new file mode 100644 index 00000000..c108baee --- /dev/null +++ b/priv/tracker/js/plausible.compat.exclusions.file-downloads.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,p=n.getElementById("plausible"),l=p.getAttribute("data-api")||(e=p.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event"),s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function r(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var u=p.getAttribute("file-types"),d=u&&u.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",f),n.addEventListener("auxclick",f);var h=window.plausible&&window.plausible.q||[];window.plausible=a;for(var w,g=0;g<h.length;g++)a.apply(this,h[g]);function v(){w!==o.pathname&&(w=o.pathname,a("pageview"))}var m,y=window.history;y.pushState&&(m=y.pushState,y.pushState=function(){m.apply(this,arguments),v()},window.addEventListener("popstate",v)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){w||"visible"!==n.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.js b/priv/tracker/js/plausible.compat.file-downloads.hash.js new file mode 100644 index 00000000..f6879523 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,r=n.getElementById("plausible"),l=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.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",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}var s=r.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),c.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var w=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,u=0;u<w.length;u++)a.apply(this,w[u]);function g(){f=o.pathname,a("pageview")}window.addEventListener("hashchange",g),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){f||"visible"!==n.visibilityState||g()}):g()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.local.js b/priv/tracker/js/plausible.compat.file-downloads.hash.local.js new file mode 100644 index 00000000..c4224305 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.local.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,r=n.getElementById("plausible"),p=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function a(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 i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.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",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}var l=r.getAttribute("file-types"),s=l&&l.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),s.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var c=window.plausible&&window.plausible.q||[];window.plausible=a;for(var w,u=0;u<c.length;u++)a.apply(this,c[u]);function f(){w=o.pathname,a("pageview")}window.addEventListener("hashchange",f),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){w||"visible"!==n.visibilityState||f()}):f()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.js b/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.js new file mode 100644 index 00000000..8c742376 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),p=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function i(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 a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var l=n.getAttribute("file-types"),s=l&&l.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),s.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var c=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<c.length;w++)i.apply(this,c[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.outbound-links.js new file mode 100644 index 00000000..10c3ad0e --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),p=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function i(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 a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function l(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,i="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||i)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!i||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",l),r.addEventListener("auxclick",l);var s=n.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),c.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=i;for(var f=0;f<u.length;f++)i.apply(this,u[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.local.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.hash.local.outbound-links.js new file mode 100644 index 00000000..f72b9178 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,r=window.document,n=r.getElementById("plausible"),l=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function a(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 i={};i.n=e,i.u=o.href,i.d=n.getAttribute("data-domain"),i.r=r.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",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function p(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",p),r.addEventListener("auxclick",p);var s=n.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),c.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var f=window.plausible&&window.plausible.q||[];window.plausible=a;for(var u,w=0;w<f.length;w++)a.apply(this,f[w]);function h(){u=o.pathname,a("pageview")}window.addEventListener("hashchange",h),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){u||"visible"!==r.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.manual.js b/priv/tracker/js/plausible.compat.file-downloads.hash.manual.js new file mode 100644 index 00000000..ab5b224b --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),l=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var s=n.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),c.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<u.length;w++)i.apply(this,u[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.manual.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.hash.manual.outbound-links.js new file mode 100644 index 00000000..1d2ff1fa --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,i=window.document,n=i.getElementById("plausible"),l=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=i.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function s(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",s),i.addEventListener("auxclick",s);var c=n.getAttribute("file-types"),u=c&&c.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}i.addEventListener("click",f),i.addEventListener("auxclick",f);var d=window.plausible&&window.plausible.q||[];window.plausible=r;for(var h=0;h<d.length;h++)r.apply(this,d[h])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.hash.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.hash.outbound-links.js new file mode 100644 index 00000000..b4815432 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.hash.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,r=n.getElementById("plausible"),l=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function a(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.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",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function s(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",s),n.addEventListener("auxclick",s);var c=r.getAttribute("file-types"),d=c&&c.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",f),n.addEventListener("auxclick",f);var u=window.plausible&&window.plausible.q||[];window.plausible=a;for(var h,w=0;w<u.length;w++)a.apply(this,u[w]);function g(){h=o.pathname,a("pageview")}window.addEventListener("hashchange",g),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){h||"visible"!==n.visibilityState||g()}):g()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.js b/priv/tracker/js/plausible.compat.file-downloads.js new file mode 100644 index 00000000..c850aad4 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.js @@ -0,0 +1 @@ +!function(){"use strict";var t,e,i,o=window.location,n=window.document,r=n.getElementById("plausible"),p=r.getAttribute("data-api")||(t=r.src.split("/"),e=t[0],i=t[2],e+"//"+i+"/api/event");function l(t){console.warn("Ignoring Event: "+t)}function a(t,e){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return l("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return l("localStorage flag")}catch(t){}var i={};i.n=t,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,e&&e.meta&&(i.m=JSON.stringify(e.meta)),e&&e.props&&(i.p=JSON.stringify(e.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&e&&e.callback&&e.callback()}}}var s=r.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(t){for(var e,i,a=t.target,n="auxclick"==t.type&&2==t.which,r="click"==t.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(e=a.href,i=e.split(".").pop(),c.some(function(t){return t==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),t.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=a;for(var w,f=0;f<u.length;f++)a.apply(this,u[f]);function h(){w!==o.pathname&&(w=o.pathname,a("pageview"))}var v,g=window.history;g.pushState&&(v=g.pushState,g.pushState=function(){v.apply(this,arguments),h()},window.addEventListener("popstate",h)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){w||"visible"!==n.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.local.js b/priv/tracker/js/plausible.compat.file-downloads.local.js new file mode 100644 index 00000000..9e77259c --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.local.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,r=n.getElementById("plausible"),p=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function a(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 i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}var s=r.getAttribute("file-types"),l=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),l.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var c=window.plausible&&window.plausible.q||[];window.plausible=a;for(var w,u=0;u<c.length;u++)a.apply(this,c[u]);function f(){w!==o.pathname&&(w=o.pathname,a("pageview"))}var v,g=window.history;g.pushState&&(v=g.pushState,g.pushState=function(){v.apply(this,arguments),f()},window.addEventListener("popstate",f)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){w||"visible"!==n.visibilityState||f()}):f()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.local.manual.js b/priv/tracker/js/plausible.compat.file-downloads.local.manual.js new file mode 100644 index 00000000..7719655d --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),p=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function i(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 a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var l=n.getAttribute("file-types"),s=l&&l.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),s.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var c=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<c.length;w++)i.apply(this,c[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.local.manual.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.local.manual.outbound-links.js new file mode 100644 index 00000000..59a9c502 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),p=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function i(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 a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function l(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,i="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||i)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!i||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",l),r.addEventListener("auxclick",l);var s=n.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),c.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=i;for(var f=0;f<u.length;f++)i.apply(this,u[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.local.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.local.outbound-links.js new file mode 100644 index 00000000..23f2da0b --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,i,o=window.location,n=window.document,r=n.getElementById("plausible"),p=r.getAttribute("data-api")||(e=r.src.split("/"),t=e[0],i=e[2],t+"//"+i+"/api/event");function a(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 i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function s(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",s),n.addEventListener("auxclick",s);var l=r.getAttribute("file-types"),c=l&&l.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),c.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",d),n.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=a;for(var f,w=0;w<u.length;w++)a.apply(this,u[w]);function h(){f!==o.pathname&&(f=o.pathname,a("pageview"))}var v,g=window.history;g.pushState&&(v=g.pushState,g.pushState=function(){v.apply(this,arguments),h()},window.addEventListener("popstate",h)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){f||"visible"!==n.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.manual.js b/priv/tracker/js/plausible.compat.file-downloads.manual.js new file mode 100644 index 00000000..b24546f2 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,r=window.document,n=r.getElementById("plausible"),l=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function i(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var s=n.getAttribute("file-types"),c=s&&s.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function d(e){for(var t,a,i=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,a=t.split(".").pop(),c.some(function(e){return e==a}))&&((r||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}r.addEventListener("click",d),r.addEventListener("auxclick",d);var u=window.plausible&&window.plausible.q||[];window.plausible=i;for(var w=0;w<u.length;w++)i.apply(this,u[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.manual.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.manual.outbound-links.js new file mode 100644 index 00000000..2e189187 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,a,o=window.location,i=window.document,n=i.getElementById("plausible"),l=n.getAttribute("data-api")||(e=n.src.split("/"),t=e[0],a=e[2],t+"//"+a+"/api/event");function p(e){console.warn("Ignoring Event: "+e)}function r(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=n.getAttribute("data-domain"),a.r=i.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function s(e){for(var t=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((a||r)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",s),i.addEventListener("auxclick",s);var c=n.getAttribute("file-types"),u=c&&c.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function f(e){for(var t,a,r=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,a=t.split(".").pop(),u.some(function(e){return e==a}))&&((i||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}i.addEventListener("click",f),i.addEventListener("auxclick",f);var d=window.plausible&&window.plausible.q||[];window.plausible=r;for(var w=0;w<d.length;w++)r.apply(this,d[w])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.compat.file-downloads.outbound-links.js b/priv/tracker/js/plausible.compat.file-downloads.outbound-links.js new file mode 100644 index 00000000..3a0de668 --- /dev/null +++ b/priv/tracker/js/plausible.compat.file-downloads.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var t,e,i,o=window.location,n=window.document,r=n.getElementById("plausible"),p=r.getAttribute("data-api")||(t=r.src.split("/"),e=t[0],i=t[2],e+"//"+i+"/api/event");function l(t){console.warn("Ignoring Event: "+t)}function a(t,e){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return l("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return l("localStorage flag")}catch(t){}var i={};i.n=t,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,e&&e.meta&&(i.m=JSON.stringify(e.meta)),e&&e.props&&(i.p=JSON.stringify(e.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&e&&e.callback&&e.callback()}}}function s(t){for(var e=t.target,i="auxclick"==t.type&&2==t.which,a="click"==t.type;e&&(void 0===e.tagName||"a"!=e.tagName.toLowerCase()||!e.href);)e=e.parentNode;e&&e.href&&e.host&&e.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:e.href}}),e.target&&!e.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!a||(setTimeout(function(){o.href=e.href},150),t.preventDefault()))}n.addEventListener("click",s),n.addEventListener("auxclick",s);var c=r.getAttribute("file-types"),d=c&&c.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function u(t){for(var e,i,a=t.target,n="auxclick"==t.type&&2==t.which,r="click"==t.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(e=a.href,i=e.split(".").pop(),d.some(function(t){return t==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),t.preventDefault()))}n.addEventListener("click",u),n.addEventListener("auxclick",u);var f=window.plausible&&window.plausible.q||[];window.plausible=a;for(var h,w=0;w<f.length;w++)a.apply(this,f[w]);function v(){h!==o.pathname&&(h=o.pathname,a("pageview"))}var g,m=window.history;m.pushState&&(g=m.pushState,m.pushState=function(){g.apply(this,arguments),v()},window.addEventListener("popstate",v)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){h||"visible"!==n.visibilityState||v()}):v()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.js new file mode 100644 index 00000000..4cf8e1f6 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,l=r.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",s=l&&l.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=l.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var n=new XMLHttpRequest;n.open("POST",p,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var t=l.getAttribute("file-types"),d=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",i),r.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,u=0;u<a.length;u++)e.apply(this,a[u]);function w(){n=o.pathname,e("pageview")}window.addEventListener("hashchange",w),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){n||"visible"!==r.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.js new file mode 100644 index 00000000..21d5f31a --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,p=r.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var t=p.getAttribute("file-types"),d=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",i),r.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,w=0;w<a.length;w++)e.apply(this,a[w]);function u(){n=o.pathname,e("pageview")}window.addEventListener("hashchange",u),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){n||"visible"!==r.visibilityState||u()}):u()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.js new file mode 100644 index 00000000..aee5e87b --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",c=p&&p.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=p.getAttribute("file-types"),u=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var i=0;i<a.length;i++)e.apply(this,a[i])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.outbound-links.js new file mode 100644 index 00000000..aa33082d --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",c=p&&p.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var r=p.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var f=0;f<i.length;f++)e.apply(this,i[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.outbound-links.js new file mode 100644 index 00000000..c9e0b44d --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",c=p&&p.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var i=0;i<c.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var i=p.getAttribute("file-types"),d=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var u,f=0;f<r.length;f++)e.apply(this,r[f]);function w(){u=o.pathname,e("pageview")}window.addEventListener("hashchange",w),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){u||"visible"!==n.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.js new file mode 100644 index 00000000..fc7c1732 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,l=n.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=l.getAttribute("file-types"),u=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var i=0;i<a.length;i++)e.apply(this,a[i])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.outbound-links.js new file mode 100644 index 00000000..216b6ada --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,l=n.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var r=l.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var f=0;f<i.length;f++)e.apply(this,i[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.hash.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.hash.outbound-links.js new file mode 100644 index 00000000..b337e342 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.hash.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,l=n.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var i=0;i<c.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props)),a.h=1;var r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var i=l.getAttribute("file-types"),u=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var d,f=0;f<r.length;f++)e.apply(this,r[f]);function h(){d=o.pathname,e("pageview")}window.addEventListener("hashchange",h),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){d||"visible"!==n.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.js b/priv/tracker/js/plausible.exclusions.file-downloads.js new file mode 100644 index 00000000..51d04308 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,p=r.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var t=p.getAttribute("file-types"),u=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",i),r.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,d=0;d<a.length;d++)e.apply(this,a[d]);function w(){n!==o.pathname&&(n=o.pathname,e("pageview"))}var f,g=window.history;g.pushState&&(f=g.pushState,g.pushState=function(){f.apply(this,arguments),w()},window.addEventListener("popstate",w)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){n||"visible"!==r.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.local.js b/priv/tracker/js/plausible.exclusions.file-downloads.local.js new file mode 100644 index 00000000..775b3a55 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.local.js @@ -0,0 +1 @@ +!function(){"use strict";var p=window.location,r=window.document,o=r.currentScript,l=o.getAttribute("data-api")||new URL(o.src).origin+"/api/event",s=o&&o.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&p.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=p.href,a.d=o.getAttribute("data-domain"),a.r=r.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var n=new XMLHttpRequest;n.open("POST",l,!0),n.setRequestHeader("Content-Type","text/plain"),n.send(JSON.stringify(a)),n.onreadystatechange=function(){4==n.readyState&&t&&t.callback&&t.callback()}}}var t=o.getAttribute("file-types"),d=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),d.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){p.href=a.href},150),e.preventDefault()))}r.addEventListener("click",i),r.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,u=0;u<a.length;u++)e.apply(this,a[u]);function w(){n!==p.pathname&&(n=p.pathname,e("pageview"))}var f,g=window.history;g.pushState&&(f=g.pushState,g.pushState=function(){f.apply(this,arguments),w()},window.addEventListener("popstate",w)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){n||"visible"!==r.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.js b/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.js new file mode 100644 index 00000000..a4d8e4ee --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",c=p&&p.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=p.getAttribute("file-types"),u=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var i=0;i<a.length;i++)e.apply(this,a[i])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.outbound-links.js new file mode 100644 index 00000000..9fffcc76 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",c=p&&p.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",l,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var r=p.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var f=0;f<i.length;f++)e.apply(this,i[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.local.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.local.outbound-links.js new file mode 100644 index 00000000..93f7084b --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var i=p.getAttribute("file-types"),u=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var d,f=0;f<r.length;f++)e.apply(this,r[f]);function w(){d!==o.pathname&&(d=o.pathname,e("pageview"))}var h,g=window.history;g.pushState&&(h=g.pushState,g.pushState=function(){h.apply(this,arguments),w()},window.addEventListener("popstate",w)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){d||"visible"!==n.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.manual.js b/priv/tracker/js/plausible.exclusions.file-downloads.manual.js new file mode 100644 index 00000000..58be8397 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,l=n.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=l.getAttribute("file-types"),u=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",r),n.addEventListener("auxclick",r);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var i=0;i<a.length;i++)e.apply(this,a[i])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.manual.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.manual.outbound-links.js new file mode 100644 index 00000000..396a88e2 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,l=n.currentScript,p=l.getAttribute("data-api")||new URL(l.src).origin+"/api/event",c=l&&l.getAttribute("data-exclude").split(",");function s(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(e){}if(c)for(var r=0;r<c.length;r++)if("pageview"==e&&o.pathname.match(new RegExp("^"+c[r].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return s("exclusion rule");var a={};a.n=e,a.u=t&&t.u?t.u:o.href,a.d=l.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(a)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var r=l.getAttribute("file-types"),u=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),u.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var f=0;f<i.length;f++)e.apply(this,i[f])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.exclusions.file-downloads.outbound-links.js b/priv/tracker/js/plausible.exclusions.file-downloads.outbound-links.js new file mode 100644 index 00000000..3e79bb09 --- /dev/null +++ b/priv/tracker/js/plausible.exclusions.file-downloads.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,p=n.currentScript,l=p.getAttribute("data-api")||new URL(p.src).origin+"/api/event",s=p&&p.getAttribute("data-exclude").split(",");function c(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return c("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return c("localStorage flag")}catch(e){}if(s)for(var i=0;i<s.length;i++)if("pageview"==e&&o.pathname.match(new RegExp("^"+s[i].trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$")))return c("exclusion rule");var a={};a.n=e,a.u=o.href,a.d=p.getAttribute("data-domain"),a.r=n.referrer||null,a.w=window.innerWidth,t&&t.meta&&(a.m=JSON.stringify(t.meta)),t&&t.props&&(a.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",l,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(a)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}n.addEventListener("click",t),n.addEventListener("auxclick",t);var i=p.getAttribute("file-types"),u=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),u.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",a),n.addEventListener("auxclick",a);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var d,f=0;f<r.length;f++)e.apply(this,r[f]);function h(){d!==o.pathname&&(d=o.pathname,e("pageview"))}var w,g=window.history;g.pushState&&(w=g.pushState,g.pushState=function(){w.apply(this,arguments),h()},window.addEventListener("popstate",h)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){d||"visible"!==n.visibilityState||h()}):h()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.js b/priv/tracker/js/plausible.file-downloads.hash.js new file mode 100644 index 00000000..286cc4b7 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,a=window.document,r=a.currentScript,l=r.getAttribute("data-api")||new URL(r.src).origin+"/api/event";function p(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=a.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 t=r.getAttribute("file-types"),s=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,n=e.target,a="auxclick"==e.type&&2==e.which,r="click"==e.type;n&&(void 0===n.tagName||"a"!=n.tagName.toLowerCase()||!n.href);)n=n.parentNode;n&&n.href&&(t=n.href,i=t.split(".").pop(),s.some(function(e){return e==i}))&&((a||r)&&plausible("File Download",{props:{url:n.href}}),n.target&&!n.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=n.href},150),e.preventDefault()))}a.addEventListener("click",i),a.addEventListener("auxclick",i);var n=window.plausible&&window.plausible.q||[];window.plausible=e;for(var c,d=0;d<n.length;d++)e.apply(this,n[d]);function w(){c=o.pathname,e("pageview")}window.addEventListener("hashchange",w),"prerender"===a.visibilityState?a.addEventListener("visibilitychange",function(){c||"visible"!==a.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.local.js b/priv/tracker/js/plausible.file-downloads.hash.local.js new file mode 100644 index 00000000..8fd2d2df --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.local.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,r=n.currentScript,p=r.getAttribute("data-api")||new URL(r.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 i={};i.n=e,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.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",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}var t=r.getAttribute("file-types"),l=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,a=e.target,n="auxclick"==e.type&&2==e.which,r="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),l.some(function(e){return e==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=e;for(var s,c=0;c<a.length;c++)e.apply(this,a[c]);function d(){s=o.pathname,e("pageview")}window.addEventListener("hashchange",d),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){s||"visible"!==n.visibilityState||d()}):d()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.local.manual.js b/priv/tracker/js/plausible.file-downloads.hash.local.manual.js new file mode 100644 index 00000000..f306f5be --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,a=window.document,n=a.currentScript,p=n.getAttribute("data-api")||new URL(n.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 i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=n.getAttribute("data-domain"),i.r=a.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 r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var t=n.getAttribute("file-types"),l=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,r=e.target,a="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,i=t.split(".").pop(),l.some(function(e){return e==i}))&&((a||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}a.addEventListener("click",i),a.addEventListener("auxclick",i);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var s=0;s<r.length;s++)e.apply(this,r[s])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.local.manual.outbound-links.js b/priv/tracker/js/plausible.file-downloads.hash.local.manual.outbound-links.js new file mode 100644 index 00000000..0d6ec299 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,i=window.document,n=i.currentScript,p=n.getAttribute("data-api")||new URL(n.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 r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=i.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props)),r.h=1;var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(r)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",t),i.addEventListener("auxclick",t);var r=n.getAttribute("file-types"),l=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),l.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}i.addEventListener("click",a),i.addEventListener("auxclick",a);var c=window.plausible&&window.plausible.q||[];window.plausible=e;for(var s=0;s<c.length;s++)e.apply(this,c[s])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.local.outbound-links.js b/priv/tracker/js/plausible.file-downloads.hash.local.outbound-links.js new file mode 100644 index 00000000..7e0876cd --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,n=r.currentScript,p=n.getAttribute("data-api")||new URL(n.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 i={};i.n=e,i.u=o.href,i.d=n.getAttribute("data-domain"),i.r=r.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",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",t),r.addEventListener("auxclick",t);var i=n.getAttribute("file-types"),l=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),l.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",a),r.addEventListener("auxclick",a);var s=window.plausible&&window.plausible.q||[];window.plausible=e;for(var c,d=0;d<s.length;d++)e.apply(this,s[d]);function f(){c=o.pathname,e("pageview")}window.addEventListener("hashchange",f),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){c||"visible"!==r.visibilityState||f()}):f()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.manual.js b/priv/tracker/js/plausible.file-downloads.hash.manual.js new file mode 100644 index 00000000..f1bffea1 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,a=window.document,n=a.currentScript,p=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function l(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return l("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return l("localStorage flag")}catch(e){}var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=a.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props)),r.h=1;var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=n.getAttribute("file-types"),s=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,i=e.target,a="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,r=t.split(".").pop(),s.some(function(e){return e==r}))&&((a||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}a.addEventListener("click",r),a.addEventListener("auxclick",r);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var c=0;c<i.length;c++)e.apply(this,i[c])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.manual.outbound-links.js b/priv/tracker/js/plausible.file-downloads.hash.manual.outbound-links.js new file mode 100644 index 00000000..f2d049a0 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,i=window.document,n=i.currentScript,l=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function p(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=i.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props)),r.h=1;var a=new XMLHttpRequest;a.open("POST",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(r)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",t),i.addEventListener("auxclick",t);var r=n.getAttribute("file-types"),c=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),c.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}i.addEventListener("click",a),i.addEventListener("auxclick",a);var s=window.plausible&&window.plausible.q||[];window.plausible=e;for(var u=0;u<s.length;u++)e.apply(this,s[u])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.hash.outbound-links.js b/priv/tracker/js/plausible.file-downloads.hash.outbound-links.js new file mode 100644 index 00000000..641da654 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.hash.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,n=r.currentScript,l=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function p(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var i={};i.n=e,i.u=o.href,i.d=n.getAttribute("data-domain"),i.r=r.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",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",t),r.addEventListener("auxclick",t);var i=n.getAttribute("file-types"),s=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),s.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",a),r.addEventListener("auxclick",a);var c=window.plausible&&window.plausible.q||[];window.plausible=e;for(var d,f=0;f<c.length;f++)e.apply(this,c[f]);function u(){d=o.pathname,e("pageview")}window.addEventListener("hashchange",u),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){d||"visible"!==r.visibilityState||u()}):u()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.js b/priv/tracker/js/plausible.file-downloads.js new file mode 100644 index 00000000..171f6984 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,r=n.currentScript,p=r.getAttribute("data-api")||new URL(r.src).origin+"/api/event";function s(t){console.warn("Ignoring Event: "+t)}function t(t,e){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(t){}var i={};i.n=t,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,e&&e.meta&&(i.m=JSON.stringify(e.meta)),e&&e.props&&(i.p=JSON.stringify(e.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&e&&e.callback&&e.callback()}}}var e=r.getAttribute("file-types"),l=e&&e.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(t){for(var e,i,a=t.target,n="auxclick"==t.type&&2==t.which,r="click"==t.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(e=a.href,i=e.split(".").pop(),l.some(function(t){return t==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),t.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=t;for(var c,d=0;d<a.length;d++)t.apply(this,a[d]);function w(){c!==o.pathname&&(c=o.pathname,t("pageview"))}var u,f=window.history;f.pushState&&(u=f.pushState,f.pushState=function(){u.apply(this,arguments),w()},window.addEventListener("popstate",w)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){c||"visible"!==n.visibilityState||w()}):w()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.local.js b/priv/tracker/js/plausible.file-downloads.local.js new file mode 100644 index 00000000..101e2525 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.local.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,n=window.document,r=n.currentScript,p=r.getAttribute("data-api")||new URL(r.src).origin+"/api/event";function t(t,e){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(t){}var i={};i.n=t,i.u=o.href,i.d=r.getAttribute("data-domain"),i.r=n.referrer||null,i.w=window.innerWidth,e&&e.meta&&(i.m=JSON.stringify(e.meta)),e&&e.props&&(i.p=JSON.stringify(e.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&e&&e.callback&&e.callback()}}}var e=r.getAttribute("file-types"),s=e&&e.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(t){for(var e,i,a=t.target,n="auxclick"==t.type&&2==t.which,r="click"==t.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(e=a.href,i=e.split(".").pop(),s.some(function(t){return t==i}))&&((n||r)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!r||(setTimeout(function(){o.href=a.href},150),t.preventDefault()))}n.addEventListener("click",i),n.addEventListener("auxclick",i);var a=window.plausible&&window.plausible.q||[];window.plausible=t;for(var l,d=0;d<a.length;d++)t.apply(this,a[d]);function c(){l!==o.pathname&&(l=o.pathname,t("pageview"))}var w,u=window.history;u.pushState&&(w=u.pushState,u.pushState=function(){w.apply(this,arguments),c()},window.addEventListener("popstate",c)),"prerender"===n.visibilityState?n.addEventListener("visibilitychange",function(){l||"visible"!==n.visibilityState||c()}):c()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.local.manual.js b/priv/tracker/js/plausible.file-downloads.local.manual.js new file mode 100644 index 00000000..3c96628a --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.local.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,a=window.document,n=a.currentScript,p=n.getAttribute("data-api")||new URL(n.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 i={};i.n=e,i.u=t&&t.u?t.u:o.href,i.d=n.getAttribute("data-domain"),i.r=a.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var r=new XMLHttpRequest;r.open("POST",p,!0),r.setRequestHeader("Content-Type","text/plain"),r.send(JSON.stringify(i)),r.onreadystatechange=function(){4==r.readyState&&t&&t.callback&&t.callback()}}}var t=n.getAttribute("file-types"),l=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function i(e){for(var t,i,r=e.target,a="auxclick"==e.type&&2==e.which,n="click"==e.type;r&&(void 0===r.tagName||"a"!=r.tagName.toLowerCase()||!r.href);)r=r.parentNode;r&&r.href&&(t=r.href,i=t.split(".").pop(),l.some(function(e){return e==i}))&&((a||n)&&plausible("File Download",{props:{url:r.href}}),r.target&&!r.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=r.href},150),e.preventDefault()))}a.addEventListener("click",i),a.addEventListener("auxclick",i);var r=window.plausible&&window.plausible.q||[];window.plausible=e;for(var s=0;s<r.length;s++)e.apply(this,r[s])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.local.manual.outbound-links.js b/priv/tracker/js/plausible.file-downloads.local.manual.outbound-links.js new file mode 100644 index 00000000..cbacef1f --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.local.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,i=window.document,n=i.currentScript,p=n.getAttribute("data-api")||new URL(n.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 r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=i.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(r)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",t),i.addEventListener("auxclick",t);var r=n.getAttribute("file-types"),l=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),l.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}i.addEventListener("click",a),i.addEventListener("auxclick",a);var c=window.plausible&&window.plausible.q||[];window.plausible=e;for(var s=0;s<c.length;s++)e.apply(this,c[s])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.local.outbound-links.js b/priv/tracker/js/plausible.file-downloads.local.outbound-links.js new file mode 100644 index 00000000..f49d54b7 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.local.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,n=r.currentScript,p=n.getAttribute("data-api")||new URL(n.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 i={};i.n=e,i.u=o.href,i.d=n.getAttribute("data-domain"),i.r=r.referrer||null,i.w=window.innerWidth,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=JSON.stringify(t.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,i="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}r.addEventListener("click",t),r.addEventListener("auxclick",t);var i=n.getAttribute("file-types"),s=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,i,a=e.target,r="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,i=t.split(".").pop(),s.some(function(e){return e==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}r.addEventListener("click",a),r.addEventListener("auxclick",a);var l=window.plausible&&window.plausible.q||[];window.plausible=e;for(var c,d=0;d<l.length;d++)e.apply(this,l[d]);function u(){c!==o.pathname&&(c=o.pathname,e("pageview"))}var f,w=window.history;w.pushState&&(f=w.pushState,w.pushState=function(){f.apply(this,arguments),u()},window.addEventListener("popstate",u)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){c||"visible"!==r.visibilityState||u()}):u()}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.manual.js b/priv/tracker/js/plausible.file-downloads.manual.js new file mode 100644 index 00000000..1560c5c9 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.manual.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,a=window.document,n=a.currentScript,p=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function l(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return l("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return l("localStorage flag")}catch(e){}var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=a.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props));var i=new XMLHttpRequest;i.open("POST",p,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(r)),i.onreadystatechange=function(){4==i.readyState&&t&&t.callback&&t.callback()}}}var t=n.getAttribute("file-types"),s=t&&t.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function r(e){for(var t,r,i=e.target,a="auxclick"==e.type&&2==e.which,n="click"==e.type;i&&(void 0===i.tagName||"a"!=i.tagName.toLowerCase()||!i.href);)i=i.parentNode;i&&i.href&&(t=i.href,r=t.split(".").pop(),s.some(function(e){return e==r}))&&((a||n)&&plausible("File Download",{props:{url:i.href}}),i.target&&!i.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=i.href},150),e.preventDefault()))}a.addEventListener("click",r),a.addEventListener("auxclick",r);var i=window.plausible&&window.plausible.q||[];window.plausible=e;for(var c=0;c<i.length;c++)e.apply(this,i[c])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.manual.outbound-links.js b/priv/tracker/js/plausible.file-downloads.manual.outbound-links.js new file mode 100644 index 00000000..827121f4 --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.manual.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,i=window.document,n=i.currentScript,l=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function p(e){console.warn("Ignoring Event: "+e)}function e(e,t){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return p("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return p("localStorage flag")}catch(e){}var r={};r.n=e,r.u=t&&t.u?t.u:o.href,r.d=n.getAttribute("data-domain"),r.r=i.referrer||null,r.w=window.innerWidth,t&&t.meta&&(r.m=JSON.stringify(t.meta)),t&&t.props&&(r.p=JSON.stringify(t.props));var a=new XMLHttpRequest;a.open("POST",l,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(r)),a.onreadystatechange=function(){4==a.readyState&&t&&t.callback&&t.callback()}}}function t(e){for(var t=e.target,r="auxclick"==e.type&&2==e.which,a="click"==e.type;t&&(void 0===t.tagName||"a"!=t.tagName.toLowerCase()||!t.href);)t=t.parentNode;t&&t.href&&t.host&&t.host!==o.host&&((r||a)&&plausible("Outbound Link: Click",{props:{url:t.href}}),t.target&&!t.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!a||(setTimeout(function(){o.href=t.href},150),e.preventDefault()))}i.addEventListener("click",t),i.addEventListener("auxclick",t);var r=n.getAttribute("file-types"),c=r&&r.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(e){for(var t,r,a=e.target,i="auxclick"==e.type&&2==e.which,n="click"==e.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(t=a.href,r=t.split(".").pop(),c.some(function(e){return e==r}))&&((i||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||e.ctrlKey||e.metaKey||e.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),e.preventDefault()))}i.addEventListener("click",a),i.addEventListener("auxclick",a);var s=window.plausible&&window.plausible.q||[];window.plausible=e;for(var u=0;u<s.length;u++)e.apply(this,s[u])}(); \ No newline at end of file diff --git a/priv/tracker/js/plausible.file-downloads.outbound-links.js b/priv/tracker/js/plausible.file-downloads.outbound-links.js new file mode 100644 index 00000000..222dadda --- /dev/null +++ b/priv/tracker/js/plausible.file-downloads.outbound-links.js @@ -0,0 +1 @@ +!function(){"use strict";var o=window.location,r=window.document,n=r.currentScript,p=n.getAttribute("data-api")||new URL(n.src).origin+"/api/event";function s(t){console.warn("Ignoring Event: "+t)}function t(t,e){if(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return s("localhost");if(!(window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)){try{if("true"==window.localStorage.plausible_ignore)return s("localStorage flag")}catch(t){}var i={};i.n=t,i.u=o.href,i.d=n.getAttribute("data-domain"),i.r=r.referrer||null,i.w=window.innerWidth,e&&e.meta&&(i.m=JSON.stringify(e.meta)),e&&e.props&&(i.p=JSON.stringify(e.props));var a=new XMLHttpRequest;a.open("POST",p,!0),a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(i)),a.onreadystatechange=function(){4==a.readyState&&e&&e.callback&&e.callback()}}}function e(t){for(var e=t.target,i="auxclick"==t.type&&2==t.which,a="click"==t.type;e&&(void 0===e.tagName||"a"!=e.tagName.toLowerCase()||!e.href);)e=e.parentNode;e&&e.href&&e.host&&e.host!==o.host&&((i||a)&&plausible("Outbound Link: Click",{props:{url:e.href}}),e.target&&!e.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!a||(setTimeout(function(){o.href=e.href},150),t.preventDefault()))}r.addEventListener("click",e),r.addEventListener("auxclick",e);var i=n.getAttribute("file-types"),l=i&&i.split(",")||["pdf","xlsx","docx","txt","rtf","csv","exe","key","pps","ppt","pptx","7z","pkg","rar","gz","zip","avi","mov","mp4","mpeg","wmv","midi","mp3","wav","wma"];function a(t){for(var e,i,a=t.target,r="auxclick"==t.type&&2==t.which,n="click"==t.type;a&&(void 0===a.tagName||"a"!=a.tagName.toLowerCase()||!a.href);)a=a.parentNode;a&&a.href&&(e=a.href,i=e.split(".").pop(),l.some(function(t){return t==i}))&&((r||n)&&plausible("File Download",{props:{url:a.href}}),a.target&&!a.target.match(/^_(self|parent|top)$/i)||t.ctrlKey||t.metaKey||t.shiftKey||!n||(setTimeout(function(){o.href=a.href},150),t.preventDefault()))}r.addEventListener("click",a),r.addEventListener("auxclick",a);var c=window.plausible&&window.plausible.q||[];window.plausible=t;for(var u,d=0;d<c.length;d++)t.apply(this,c[d]);function f(){u!==o.pathname&&(u=o.pathname,t("pageview"))}var h,w=window.history;w.pushState&&(h=w.pushState,w.pushState=function(){h.apply(this,arguments),f()},window.addEventListener("popstate",f)),"prerender"===r.visibilityState?r.addEventListener("visibilitychange",function(){u||"visible"!==r.visibilityState||f()}):f()}(); \ No newline at end of file diff --git a/tracker/compile.js b/tracker/compile.js index b0aa42e7..0b69d292 100644 --- a/tracker/compile.js +++ b/tracker/compile.js @@ -16,7 +16,7 @@ function compilefile(input, output, templateVars = {}) { fs.writeFileSync(output, result.code) } -const base_variants = ["hash", "outbound-links", "exclusions", "compat", "local", "manual"] +const base_variants = ["hash", "outbound-links", "exclusions", "compat", "local", "manual", "file-downloads"] const variants = [...g.clone.powerSet(base_variants)].filter(a => a.length > 0).map(a => a.sort()); compilefile(relPath('src/plausible.js'), relPath('../priv/tracker/js/plausible.js')) diff --git a/tracker/src/plausible.js b/tracker/src/plausible.js index 207f2e1a..916d0db7 100644 --- a/tracker/src/plausible.js +++ b/tracker/src/plausible.js @@ -43,10 +43,12 @@ } {{#if exclusions}} - if (excludedPaths) - for (var i = 0; i < excludedPaths.length; i++) + if (excludedPaths) { + for (var i = 0; i < excludedPaths.length; i++) { if (eventName == "pageview" && location.pathname.match(new RegExp('^' + excludedPaths[i].trim().replace(/\*\*/g, '.*').replace(/([^\.])\*/g, '$1[^\\s\/]*') + '\/?$'))) return warn('exclusion rule'); + } + } {{/if}} var payload = {} @@ -92,8 +94,9 @@ } if (link && link.href && link.host && link.host !== location.host) { - if (middle || click) - plausible('Outbound Link: Click', {props: {url: link.href}}) + if (middle || click) { + plausible('Outbound Link: Click', {props: {url: link.href}}) + } // Delay navigation so that Plausible is notified of the click if(!link.target || link.target.match(/^_(self|parent|top)$/i)) { @@ -117,6 +120,50 @@ registerOutboundLinkEvents() {{/if}} + {{#if file_downloads}} + var defaultFileTypes = ['pdf', 'xlsx', 'docx', 'txt', 'rtf', 'csv', 'exe', 'key', 'pps', 'ppt', 'pptx', '7z', 'pkg', 'rar', 'gz', 'zip', 'avi', 'mov', 'mp4', 'mpeg', 'wmv', 'midi', 'mp3', 'wav', 'wma'] + var fileTypesAttr = scriptEl.getAttribute('file-types') + var fileTypesToTrack = (fileTypesAttr && fileTypesAttr.split(",")) || defaultFileTypes; + + function handleDownload(event) { + + var link = event.target; + var middle = event.type == "auxclick" && event.which == 2; + var click = event.type == "click"; + + while(link && (typeof link.tagName == 'undefined' || link.tagName.toLowerCase() != 'a' || !link.href)) { + link = link.parentNode + } + + if (link && link.href && isDownloadToTrack(link.href)) { + + if (middle || click) { + plausible('File Download', {props: {url: link.href}}) + } + + // Delay navigation so that Plausible is notified of the click + if(!link.target || link.target.match(/^_(self|parent|top)$/i)) { + if (!(event.ctrlKey || event.metaKey || event.shiftKey) && click) { + setTimeout(function() { + location.href = link.href; + }, 150); + event.preventDefault(); + } + } + } + } + + function isDownloadToTrack(url) { + var fileType = url.split(".").pop(); + return fileTypesToTrack.some(function(fileTypeToTrack) { + return fileTypeToTrack == fileType + }) + } + + document.addEventListener('click', handleDownload); + document.addEventListener('auxclick', handleDownload); + {{/if}} + var queue = (window.plausible && window.plausible.q) || [] window.plausible = trigger for (var i = 0; i < queue.length; i++) { -- GitLab