javascript - Measure how quickly users abandon slowly loading pages -


i'm trying measure how users abandon loading pages.

my plan register listener "unload" event possible, , send value of performance.now() using navigator.sendbeacon()

my problem "unload" event appears not fire if "domcontentloaded" hasn't fired yet. suppose makes sense ... can unloaded if hasn't been loaded yet? still need workaround measure how users abandon page if abandon before "domcontentloaded".

i've attempted listen "abort" event, doesn't seem fire. guess fires if download interrupted, , isn't fired when dom parsing interrupted.

any suggestions on how measure this?

ps: suggestions don't work in browsers welcome.

edit: i've read jquery ajaxerror() handler fires if user leaves page before page finishes loading, , tried build solution registers "abort" handler on xmlhttprequest server intentionally answers slowly. produce event, fires in case of navigation, doesn't fire if tab closed. there's no guarantee runs, unlike "unload" event. solution works better.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -