You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the trackEvent and trackView functions fire off the collectfetch request, but there's no way for the client to track its progress. As a suggestion, the library could return the underlying fetchPromise, 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).
The text was updated successfully, but these errors were encountered:
Currently, the
trackEvent
andtrackView
functions fire off thecollect
fetch
request, but there's no way for the client to track its progress. As a suggestion, the library could return the underlyingfetch
Promise
, so it could beawait
-ed by the client code.I'd find this useful, for example, if I want to track a click on an
a
tag with ahref
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 asetTimeout
, but that's not pretty).The text was updated successfully, but these errors were encountered: