continuing the first article I've wrote some time ago...
...I've found out some improvement to apply both the original and my (later) modification of the Google-Analytics engine:
the original code, didn't check if
On the same 'spirit', but different-
the original code loads external-resource (
analytics.js) dynamically, but executes
ga(...)function sequentially, sometimes (in about 20%, in most modern browsers), the remote-resource is not loading fast enough,
so the later execution of
ga-function, does nothing. That's bad.
the prefix of the whole preparation, setting
ga.qis redundant, since the
analytics.jswill overwrite those definitions anyway...
gafunction operations, only on the script onload event (which both ignore error cases and provide asynchronous operation, the proper-way!)
btw, its (yet...)