Let Rudderstack manage the when to send track event instead of explicitly checking rudderAnalyticsReady condition
Background:
During the implementation of new events regards to near wallet sunset, I have encountered that some of the events weren't firing to rudderstack even if they have eventLabel present. After investigation, I remembered that there was a condition in place to check rudderstack initialize complete and only then send track events. Previously it was enough to cater for wallet migration implementation. However, on near sunset, we are tracking events that occur during visiting landing page + visiting unsupported page and redirect event. This is normally happening in the very early stage of the render and it wasn't sending events because rudderAnalyticsReady wasn't ready. Was planning to implement logic to wait until initialization is complete, but before going to it, I was experimenting that if rudderstack actually handles this type of situation internally where, many other analytics now actually store the events in buffer if track event actually happens before initialization completes. (And send the events after automatically) And luckily it handles internally so decided to remove unnecessary logic.
This PR contains two minor fixes:
rudderAnalyticsReady
conditionBackground: During the implementation of new events regards to near wallet sunset, I have encountered that some of the events weren't firing to rudderstack even if they have
eventLabel
present. After investigation, I remembered that there was a condition in place to check rudderstack initialize complete and only then send track events. Previously it was enough to cater for wallet migration implementation. However, on near sunset, we are tracking events that occur during visiting landing page + visiting unsupported page and redirect event. This is normally happening in the very early stage of the render and it wasn't sending events becauserudderAnalyticsReady
wasn't ready. Was planning to implement logic to wait until initialization is complete, but before going to it, I was experimenting that if rudderstack actually handles this type of situation internally where, many other analytics now actually store the events in buffer if track event actually happens before initialization completes. (And send the events after automatically) And luckily it handles internally so decided to remove unnecessary logic.