Friday, July 25, 2014

Track:js: Hello World!

Like many web programmers, I wear two programming hats.  One hat is for the server-side, and whenever I make a mistake on the server side, bells and whistles go off, I get an email with a stakc trace, plus a Growl alert, a siren, and my cat arches his back and hisses.  I know right away when there is trouble in paradise.

The other hat is for the client-side.  Ugggh.  In JavaScript, no one will hear you scream.  When your little JavaScript snippet blows up, it leaves your page in a precarious half-useful state.  It might look OK but when you start trying to do stuff, things just don't work.  As a programmer you're used to this crap happening, and you start up FireBug or Developer Tools or what have you, more-or-less out of habit. You even do it on other people's sites.

But when your customers encounter an error, they immediately go to your competitor's site.  The problem has been around since Mosaic 0.1 beta.  You, as a programmer, need an alert when JavaScript blows up on the client's browser, wherever that may be.

Enter track:js. Think of it as an sniffer, logger and aggregator for all your site's JavaScript errors.   Pretty nice, but does it tamper with the user experience?  Do they need browser plugins, or the beta version of browser X that's not due until next year?  Nope.  Track:js does it's magic all with standard JavaScript.  That proves what you've known all along - JavaScript is tremendously powerful, even if it's  still a PITA.   Track:js seems to leverage it to the n'th degree.

We're total sceptics at the Cornell School of Hotel Administration, so we got a trial key and gave it a whirl.  We just popped this into our standard header:



And away we go.  After a few days we checked the handsome looking dashboard to see what's up.



It's a little bit of a shock to see your perfect website generating JavaScript errors that you've never heard about.  Surely it wasn't YOUR code, was it?  Did gremlins get hold of your Github account?  Ah well.  In the next day or two, we'll see what's up.

Oh, and all this nice stat gathering doesn't seem to affect performance.  The site is still nice and peppy.  So far, so good.

No comments: