mixpanel-js icon indicating copy to clipboard operation
mixpanel-js copied to clipboard

Mixpanel's track() does not fire callback

Open gfx opened this issue 8 years ago • 0 comments

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.

gfx avatar Nov 13 '17 03:11 gfx