Add analytics and better error handling.

No worries, we'll honour your Do-Not-Track preferences.