minimal-analytics
minimal-analytics copied to clipboard
Minimal versions of popular analytics libraries. Reduce the impact of third-party scripts on your application.
Context: Derived from the [jsDeliver source](https://cdn.jsdelivr.net/npm/@minimal-analytics/ga4/dist/index.js) of `minimal-analytics`, I created `tag.js` which has evolved into a more advanced self-hosted substitute with basic dataLayer functionality and most `gtag()` configuration fields, with...
Add support for Web Worker and ServiceWorker contexts with the following changes * When `navigator.sendBeacon` isn't available, default to `XMLHttpRequest` (Worker) or `fetch` (ServiceWorker) * When `sessionStorage` or `localStorage` isn't...
Direct localStorage/ sessionStorage access prevents usage from Worker context or Safari Private tab
[`WorkerGlobalScope`](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope#inherited_from_workerglobalscope) (which `ServiceWorkerGlobalScope` inherits from) does not include `localStorage` or `sessionStorage`, but using `@minimal-analytics@gav4` in a ServiceWorker context throws a `ReferenceError` because of this hard dependency. It also throws a...
I'm testing out `@minimal-analytics/ga4` on [KaiOS](https://kaiostech.com/) apps but I'm running into an issue with because package apps are served with an origin like `app://myapp.com/`. The document location includes the `app:`...
I have tested the minimal analytics script for GA4 in a Magento shop with the default installation instruction: (()=>{"use strict";var e={508:(e,t,n)=>{function o(e,t=300,n=0){return(...o)=> ....................... analytics.com/g/collect";navigator.sendBeacon(`${r}?${s}`),k(t),m=!0}e.track=D,r&&(window.track=D),a&&D()})(),o})() https://requirejs.org/docs/errors.html#mismatch at makeError (require.min.js:17:53) at intakeDefines...
I tried using https://minimalanalytics.com/ on my website. I placed the script in the head and replaced the identifier. It didn't work; I got an error in the console. Then, I...
Closes #56. For a more radical approach, see #58
When browsing the [DaisyUI Website](https://daisyui.com/) that uses minimal-analytics, the navigation to links does not work. In the console of the browser an error is displayed linking to code of minimal-analytics:...