Whenever the window location changes API calls called are canceled by the browser.
I am firing analytics events on-click of a button which also takes to a subdomain and refreshes the page, so there is a race condition now. Sometimes the event is resolved and sometimes it is canceled by the browser.
the possible workaround I found are as follows
- wait for the event to be resolved before redirecting
- store in local storage and fire on returning back
- pass the event to be fired as query param to the subdomain and fire it there
Is there a better solution for this ?