mixpanel-js
mixpanel-js copied to clipboard
is it possible to flush all batched events at once?
I know there is
mixpanel.track('my event', {foo: 'bar'}, { 'send_immediately': true });
Similarly, I know I can edit the config - but that only effects following events, plus I still want batching.
mixpanel.set_config({ batch_requests: false });
// or
mixpanel.set_config({ batch_flush_interval_ms: 0 });
Use Case: I have a large batch_flush_interval_ms
interval and want to flush everything before navigation to a new external URL, but I don't want to give up my batching and use send_immediately
every time I call mixpanel.track
I have tried editing the flushAfter
property of the events queued inside localStorage with no luck.