Commit graph

2 commits

Author SHA1 Message Date
27b07a5cfc fix: patch umami.js to work with Next.js async script injection
document.currentScript is always null for async scripts (which is how
next/script afterInteractive works). Umami's first check was:
  const{currentScript:l}=c; if(!l)return;
This caused an immediate exit — zero tracking.

Fix: fall back to querySelector('script[data-website-id]') when
currentScript is null, so Umami finds its own script tag and reads
the data-website-id / data-host-url attributes correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 21:21:53 +05:30
4e90064989 fix: self-host Umami script to bypass Cloudflare cross-origin 503
analytics.manohargupta.com/script.js returns 503 when loaded as a
browser sub-resource from tia.manohargupta.com (same Cloudflare Bot
Management issue as R2 images). Fix: serve the script from /umami.js
(same origin, no cross-origin block) and use data-host-url to tell it
where to POST events back to the Umami instance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:16:51 +05:30