ReviewOS

stacks/ts-analytics

sendBeacon failure falls back to async XHR on unload; no double-include guard

#138
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Severity: Medium · Where: Analytics.ts:3280-3284 (beacon fallback), Analytics.ts:3241 (no init guard) On page-leave, sendBeacon failure falls back to async XHR which the browser may cancel → engagement/unload data loss. Separately, the IIFE has no double-include guard, so a twice-loaded script double-counts events. Fix: Prefer beacon and accept loss / use fetch(keepalive); add a window.__tsa init guard.

Sign in to comment on this issue.