Closed
Description
Currently, the trackEvent
and trackView
functions fire off the collect
fetch
request, but there's no way for the client to track its progress. As a suggestion, the library could return the underlying fetch
Promise
, so it could be await
-ed by the client code.
I'd find this useful, for example, if I want to track a click on an a
tag with a href
attribute. In the current situation, if I add a custom @click
handler and call { umTrackEvent(..); window.location.href = ...}
, I can't think of a clean way to guarantee that the event has been sent before the browser loads the new page and aborts the tracking request (of course, one can use a setTimeout
, but that's not pretty).
Metadata
Metadata
Assignees
Labels
No labels