To minimize the traffic sent to the stats endpoint we should track MinervaClientError counter only once after the request is done, not on every error occurrence.
Additionally tracking once per request should allow us to find out what is the average errors count per page view (is it just one error from time to tome, or is it multiple errors at the same page view)
= Acceptance criteria
 Rather than adding 1 to counter.MediaWiki.minerva.WebClientError we will use an unload event to add all errors in one go.
= Developer notes
[[ https://gerrit.wikimedia.org/r/467984 | Piotr's patch ]] does the job but [[ https://gerrit.wikimedia.org/r/489749 | was reverted ]] so we can take time to talk through the details in grooming and Sam's comment below. It can be be reapplied and +2ed when that's happened and we've given it the OK.