Restore both Umami and Cloudflare Web Analytics with adblock bypass tunnels

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-20 16:07:47 +01:00
parent 6dac6c9c2b
commit b017a8ace4
2 changed files with 21 additions and 0 deletions

View File

@@ -25,6 +25,20 @@ function loadAnalytics() {
script.dataset.hostUrl = '/stats'
script.dataset.analytics = '1'
document.head.appendChild(script)
loadCloudflareTunnel()
}
function loadCloudflareTunnel() {
if (document.querySelector('script[data-cf-beacon]')) {
return
}
const script = document.createElement('script')
script.defer = true
script.src = '/cdn-cgi/beacon.min.js'
script.dataset.cfBeacon = '{"token":"5f2f3b8e1f824be6984a348fe31d2f04","spa":true}'
document.head.appendChild(script)
}
export function initCookieConsent() {