Google Analytics provides a great deal of valuable information on the performance of your marketing campaigns, and how visitors interact with your site.
But it is not a log analysis application, and therefore it does not track error pages “out of the box”, unless of course you configure it to do so.
Tracking the dreaded “404 Error Document not Found” page enables site
managers to identify broken links and to fix them. Apparently, there are even some people who will create content to match errors that occur often.
How do I start tracking 404 error pages?
First, you must create a custom 404 error page, and instruct your web server to use it instead of the standard ugly one.
This new page will be tagged with your Google Analytics tracking code, but first, you will need to add a line of code to the tracking code (for this page only!)
<script type="text/javascript"src="http://www.google-analytics.com/urchin.js"></script>
<script type="text/javascript">
_uacct = "XXXXX-X";
urchinTracker("/404/" + _udl.pathname + _udl.search);
</script>
Please, only copy the bold line! You must insert this line just underneath YOUR _uacct line
That’s it!
How do I see the reports?
Now to view the report on your 404 error pages:
1) Login to Google Analytics
2) Click on Content Optimization >> Content Performance >> Content Drilldown
You will notice a new directory called 404, and if you click on the
directory icon, you will see a list of referring pages.
You may want to go take a look at these pages and fix those broken links!
That’s a brilliant hack to track something that is typically only in log files.
Of course, another good way to find your 404 pages, also from Google, is through Google WebMaster Tools:
http://www.google.com/webmasters/
They provide a collection of fascinating data from Google’s last crawls of your site.
They also show what phrases your site is showing up in the results for, and which phrases are driving the most clicks to your site.