Bryan Pieper's Blog : Google Analytics

Looking for a way to track your 404 pages using Google Analytics? Modify the ‘_trackPageview’ function call.

By default, Google Analytics doesn’t have a way to classify the 404 pages. Before you begin, you’ll need to be able to detect a 404 page on the server side. If you cannot determine the response status, this will not work for you.