mixpanel-js
mixpanel-js copied to clipboard
Mixpanel's track() does not fire callback
I'm not sure what happens but sometimes track() does not fire callback. For now, I add a workaround snippet to fire callbacks, but It's better if mixpanel-js handles it.
My workaround is something like that:
const timeoutId = setTimeout(() => {
window.location.assign(newPath);
}, 5000 /* timeout */);
mkxpanel.track(a, b, () => {
clearTimeout(timeoutId);
window.location.assign(newPath);
});
I think XMLHttpRequest#timeout should be set, anyway.