There might be cases where the GA tracker must be loaded with some delay. With the current implementation this completely breaks the functionality of sending events to Google Analytics.
The problem is that the dispatchToGa function is defined once, on the module's config phase and if for any reason the GA script is not loaded yet, then it won't do any action, never.
The proposed solution is to perform the verification of which tracker is being used on every call, and then dispatch to the correspondent function.
There might be cases where the GA tracker must be loaded with some delay. With the current implementation this completely breaks the functionality of sending events to Google Analytics. The problem is that the
dispatchToGa
function is defined once, on the module's config phase and if for any reason the GA script is not loaded yet, then it won't do any action, never.The proposed solution is to perform the verification of which tracker is being used on every call, and then dispatch to the correspondent function.