Page Not Found: Analytics Can Find Your Broken Pages

by Aris Abramian on May 25, 2012

in Analytics

404. These 3 digits are the greatest threat to your website. When your server can’t find the file or page, it shows a 404 page telling both search engines and your potential customers that it’s missing. These pages by default  look horrible.

Usually something like this:

or

Very unappealing and unlikely to improve your visitor’s experience or impress Google with useful content!

Contrast with a 404 page that has had some thought put into it. This is Blizzard Entertainment’s 404 page (Blizzard is responsible for games such as World of Warcraft and Diablo, if you’re unfamiliar with the company).


This is a great 404 page, because it’s:

  • Funny
  • Targetted to a specific audience
  • Lets visitors navigate to other parts of the site

So how do I find my 404 pages?

Every page on your website should have Google Analytics tracking code installed on it. Your 404 page will need a slightly different tracking code so you can find it in your Analytics Content Report.

<script type="text/javascript">// < ![CDATA[
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); 
// ]]></script><script type="text/javascript">// < ![CDATA[
try{
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&#038;from=" + document.referrer);
} catch(err) {}
// ]]></script>

After you’ve added the code above to your 404 page,  look for /404.html in your Content Report  and you’ll begin seeing all the 404 pages, as well as where they are being linked from.

The ideal situation is to avoid 404s altogether. We all have pages that either are linked to incorrectly or don’t exist anymore, and by using Analytics you can pinpoint the ones that need your attention most. You’ll be amazed at the increase in engagement (and rankings) when your website doesn’t produce 404s.

PS: Make sure you replace UA-xxxxx-x in the Analytics code with your own profile ID!

Start fixing these and watch as your exit and bounce rates improve, your time on site increases, and eventually conversions as well!

 

Share!

  • Didar

    This is a great post. I was confused whether or not to put analytics code in 404 pages of our site.
    Thanks for sharing.

    Didar

Previous post:

Next post: