Document.async - javascript tracking code

Hi,

We are on piwik 2.3. A while back; and I am not sure which version they were on, but I assume it was at least 2.x; piwik
was “locking up” due to the mysql db area running out of space (I was not working here then). Considering this, I was
looking at the piwik javascript code. I noticed the document.async call and found on the web:

So far, this is the only reference to async being depreciated. So, I am not 100% sure if this is happening or not.
My impression with async being used is that the web page using the javacript call to the piwik server should not
be affected hanged up if the piwik server fails (like due to mysql db area out of space or some server problem).
If this is not the case and the page will hang when making a piwik call if the piwik server does not return quickly,
can a timeout function be used.

In any case, can the call to piwik server be wrapped in a timer that would “say” cancel the call to the piwik server
if it is not responding in X time, lets say 5ms or what ever the admin. wants. Might be good to be configurable
on a per server basis…

Hope this make sense.
Thanks,
Douglas

If you use the latest JavaScript tracking code, available in Settings > Tracking code in your Piwik, then you are using the asynchronous code.

when using async code, if piwik is down, it should not affect the display and loading of the web pages being tracked.

Are you seeing a case where this is not true?

See the JS tracking code doc here: JavaScript Tracking Client: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Hi,

Yes, that is what happened. They were on 2.1 then and I am working with 2.3. As I understand it, there were several
servers using the js code as given by the 2.1 interface. Apparently, then mysql server that is on another machine ran
out of space. At that point in time, the web pages that used the js code to access piwik hung. Once again, this is what
has been told to me. Upon hearing this, I looked at the js code and noticed the async. Upon checking out the async
I noticed on the web the above link saying it was depreciated.

In any case, the pages using piwik 2.1 were not working and the people involved told me they thought it was due to
the mysql server running out of space. My concern is that the pages hung. Also, please note that as far as I know,
this happened only once and they have not used piwik since then.

My questions right now are:

  1. Is the link I posted correct? It is the only one I have found so far.
  2. Since the pages accessing piwik hung, would a document.settimeout() be a good thing to use?
  3. If this happens again, what should I look for:
    a) during the time that pages are accessing piwik and hanging, what should I look at?
    b) if I am not able to see access during the “crises”, what would be the recommendations for postmortem.

Thanks,
Douglas