add analytics; send error stats to analytics