Coders: Sign up for our skill & salary based job alerts! Learn More

 

Using Mixpanel to log client side errors (javascript)

( If you haven't checked out Mixpanel yet, go check it out now. Especially their new Flow product. Very slick. )

Ok, this is a twist on the post on hackernews about logging with google analytics. One of the things mentioned was that it wasn't real-time. While very cool, real time is needed if your site is breaking. I can't wait 3 hours to know that my users can't log in or are having trouble applying to a job. 

First, go sign up for mixpanel. It's free and they give you a bonus if you put their badge in your footer. Once you a mixpanel account, just add their js snippet to the <head> of your layout.

You can get more info at Mixpanel's javascript integration page

Immediately below the Mixpanel <script> snippet add another snippet:

Now whenever js errors occur, you'll see it in mixpanel.

Additionally, because you can track the actions of your users from page to page, you'll be better equipped to recreate the scenario. 

The easiest way to view errors I've found so far, is to go to the Segmentation tab and choose the event ('js-err'). When I initially set this up, I named mine "error", but the concept is the same.

Give Your Take!

Copyright © 2012 ~ n3rds.com ~ All Rights Reserved
Programmer Login Post a Job