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
Trying to track event mixpanel.track('my event', undefined (response) => {...handling error response...}) and expecting to get error if smth went wrong
export function track(
event_name: string,
properties?: Dict,
optionsOrCallback?: RequestOptions | Callback,
callback?: Callback, <-- I'm want to handle error response here (for example { "error": "token, invalid format", "status": 0 })
): void;
If I track event without setting RequestOptions['send_immediately'] equals to true then my callback is called before request to mixpanel has been finished here:
The text was updated successfully, but these errors were encountered:
Yes, in the default mode, track requests are batched and sent over the network at regular intervals. The track() callback is executed when the event is enqueued for transfer, while the actual network-sending mechanism is separate and occurs on a timer. We don't currently expose any callback from the network side of the tracking code.
Yes, in the default mode, track requests are batched and sent over the network at regular intervals. The track() callback is executed when the event is enqueued for transfer, while the actual network-sending mechanism is separate and occurs on a timer. We don't currently expose any callback from the network side of the tracking code.
@tdumitrescu if send_immediately: true is passed in the options does the callback execute when the event gets sent (not enqueued)? Also, are there any docs that talk more about this? Thanks
@josuemy yes, with send_immediately there is no enqueueing, and the callback should fire when the network request returns. I don't know of any docs around this atm.
Hello! : )
I'm not sure that this is correct behavior
persistence: 'localStorage'
mixpanel.track('my event', undefined (response) => {...handling error response...})
and expecting to get error if smth went wrongIf I track event without setting
RequestOptions['send_immediately']
equals totrue
then my callback is called before request to mixpanel has been finished here:The text was updated successfully, but these errors were encountered: