Dead End Page – How To Track Error 404 – Page Not Found

Dead End - Page Not FoundLanding on a website and getting a 404-Page Not Found error is frustrating.  But owning the website with those errors can mean lost money.  If you’re not already tracking these errors, here’s your primer to start today.

If you’re here to implement 404 Page Not Found tracking and know why you need it, you can skip this first section.  If not, I’ll cut to the chase.  Tracking when your website visitors request a page that doesn’t exist has many advantages.  To do this is not just a nice feature to implement, it’s a requirement.  The downside to this is a very poor user experience.

  1. You may have links into your website from other sites that you aren’t aware of.  Those links may be pointing to non-existent pages on your website.  This has two major downsides:
    • Visitors hate 404 – Page Not Found errors.  They typically bail on the site rather than work to find out the real page they were meant to land on.
    • Search engines can’t pass any of their link love from the other site to yours.  Losing that love is a tragedy.
  2. The tactic of creating a custom 404 page is good business.  It forces you to consider the scenario and how you would like to be perceived should someone land on a dead page on your site.

The Code

Common Code

Regardless of your vendor you will need to either locate the current 404 page on your webserver or create one if one doesn’t exist.  This is where you’ll be creative and really consider the user experience with humor, information (sitemaps?) or redirects.

On this custom 404 page you will tag it like all of your other webpages with the following exceptions.  One for Google Analytics and for (Adobe) Omniture’s SiteCatalyst.

Google Analytics

For Google there are two tagging versions you can consider depending where you are in your timeline of migrating from their synchronous versions to their latest asynchronous version.

Note that as of this writing I personally have run into a significant problem with the asynch code and have rolled it back until it can be addressed by Google.

The code snippets below are your typical code snippets provided by Google Analytics with the addition of detailed trackPageview parameters.  These parameters allow your reporting to expose which page the visitors were trying to reach and where they came from.  See Google’s explanation of 404 tracking.

Old School: Synchronous code
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));

var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + + "&from=" + document.referrer);
} catch(err) {}
New school: Asynchronous code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview', '/404.html?page=' + document.location.pathname + + '&from=' + document.referrer]);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Regardless of which version of code snippet you use, your reports will look similar to this.

Sample Resulting Report

google analytics 404 error pages not found report

Google Analytics Report - Click To Enlarge

The simplest way to view these reports is to create an advanced segment that sets the Page as containing “/404.html”, or whatever your custom 404 page URL begins with.  Make sure it is qualified as “contains” and not “matches exactly” or anything else.

After applying this advanced segment go to “Content-Top Landing Pages”, from there you’ll be able to see a report detailing each instance of the 404 error along with the intended destination page and the site the inbound link came from.


sample code


Do not set the s.pageName variable on this page!

From (Adobe) Omniture’s SiteCatalyst v14 Implementation Manual

SiteCatalyst pageType Implementation

SiteCatalyst pageType - Click To Enlarge

2.1.44 pageType

The pageType variable is used only to designate a 404 Page Not Found Error Page. It only has one possible value, which is “errorPage.” On a 404 Error Page, the pageName variable should not be populated.

Table: pageType Variable Parameters

The pageType variable captures the errant URL when a 404 Error Page is displayed, which allows you to quickly find broken links and paths that are no longer valid on the custom site. Set up the pageType variable on the error page exactly as shown below. Do not use the page name variable on 404 error pages. The pageType variable is only used for the 404 Error Page.

! NOTE: In most cases, the 404 Error Page is a static page that is hard-coded. In these cases, it is important that the reference to the .JS file is set to an appropriate global or relative path/directory.

Syntax and Possible Values

The only allowable value of pageType is “errorPage" as shown below.




SiteCatalyst Configuration Settings


Pitfalls, Questions and Tips

To capture other server-side errors (like 500 errors), use a prop to capture the error message and put “500 Error:

<URL>” where <URL> is the URL requested, in the pageName variable. By following this course of action, you can use Pathing Reports to see what paths caused users to generate 500 errors, and the prop will explain which error message is given by the server.
omniture sitecatalyst pages not found report

Omniture SiteCatalyst Report - Click To Enlarge

Tracking 404 Error Pages Improves Visitor Experience

This tactic has proven invaluable to me and my clients.  Over time we notice the number of visits to the custom 404 page go down because we create custom 301 redirects for each bad inbound link and redirect to the most appropriate page on the site.  This regular maintenance slowly firms up your website and in the end creates a better visitor experience.

We Don’t Need No Stinking Web Analytics!

We Don't Need No Stinking Web Analytics

  • Perhaps you’ve been told to add it to your site.
  • Maybe your client is asking for details that your raw web logs can’t answer.
  • Maybe you’re so deep into your tactics you’ve come to realize the only way you can optimize them is with the sophistication provided by web analytics.

Those of you in the above categories can already answer the question, “why use web analytics” and have a solid, concrete reason to do so.

I’m going to speak to those who have heard of it, but aren’t sure why they should use web analytics?

Is This You?

  • No boss to report stats to?
  • No active campaigns tied to a marketing campaign?
  • Early in implementation of something big that’s not ready for prime time?
  • Not really interested in the complexity of tagging or the resulting reporting tools?
  • Don’t even have a website to tag with web analytics?

These are common situations I run into and you can even group and expand them to include more people who may not even be as close to their web presence as these people are.  Those people may also benefit from web analytics in support of their tactics, campaigns and initiatives.

If you look at these roles and their interest in web analytics you can really speak to them as a whole.  You can bring them with you as they lose their web analytics virginity.  The result is a Kool-Aid drinking fanatic who will help you promote implementations, customizations and dependence on web analytics into higher level business decisions.

The Top 3 Answers: “Why Use Web Analytics?”


Benchmarking DataFor those who don’t need it now, you will one day. If you don’t know why you need or didn’t even know about web analytics until recently, this is the first reason you need it.  One day you will need to know how well your website and web presences are “performing”.

Don’t even worry about what I mean by performing.  It doesn’t matter.  The reason it doesn’t matter is that with just the most basic of implementations of web analytics (the same exact tag on every page) you will begin collecting so much data that you will be amazed one day in the future.

This basic tagging is so simple I consider it a zero dollar ($0) investment.  How can you argue that math?

Whether that future need is for you or for someone you bring in to manage it, they will need historical data.  If you bring someone in (internal or external) and immediately ask them to affect the following changes:

  • Increase our organic rankings
  • Track our pay-per-click campaign success

How can you expect them to measure their progress without historical data?  Sure you could tag your site and collect two weeks’ worth of data as a benchmark, but what if you have peaks and valleys within a month?  Or even within a year?

If you have data back to the beginning of time (when your website went live) then you will be able to slice and data all future work and set goals for that works with a much higher level of certainty!


Today's ProblemsWith a basic to basic Plus implementation of web analytics you will quickly find problems on your website from day two.  I guarantee it.  There is always room for improvement.  Here are some of the common quick wins I find almost immediately with my implementations.

  • Pages not found – Error 404.  While this does require one additional implementation step to your tagging process (you need to implement a custom 404 error page and tag it slightly differently than the others), it will almost certainly illuminate your 404 errors.  Nothing is more frustrating than visiting a site and initially landing on a bad page due to a bad or outdated inbound link.

While this will not solve that first visitors experience, once you find out what the bad link is you can correct it with some simple redirecting.

  • Internal traffic is muddying up your data

Your report can quickly hone in on your website visitors and many times I have found that internal visits are artificially inflating either poor performing metrics or overstating the important high performers.  Rarely does anyone want to track their internal visits in the same view as their targeted external visitors.  Next step is to exclude yourself from your web analytics reports.

  • Misspellings on your website

Taking a quick look at the organic keywords that are driving traffic to your site, I am continually surprised at how many misspellings this tactic finds on a website.  The value of this exercise eventually drops off but in the beginning it pays big time.

I am continually taking the keyword string that a visitor used to find one of my sites and actually running it myself on the search engine they used.

Make sure you’re not using personalized search for this exercise otherwise your results will not closely match what your visitor saw.  For example, not only should you log out of your Google account, but you should also append “=pws=0” to the resulting search result to truly make them non-personal.

Now looking through these search results, if one of the search terms was a misspelling and one of your pages is in the results, audit that page to see if there is a misspelling or if the search engine did the right thing by interpreting the misspelling.  Rarely will you find a misspelling on your website.  But when you do, it’s gold.

Nothing is worse than a misspelling on a website.  I will gladly lose that search traffic rather than have a visitor see a typo.


Diamond in the roughThere is always an opportunity waiting to be found in your initial web analytics reports. (Actually viewing visitor actions is an even more enlightening experience) .  Stumble around some of the predefined reports and gain insight into how your visitors are using your website, where they’re coming from and where they’re going.  After that create advanced segments (in Google Analytics) to target a specific question.

If you’re lucky you may find some diamonds like:

  • High pageview pages (other than the usual first place page – the homepage).  Does this page surprise you?  Is it a deep page on your site that you paid little attention to?  Does it not only get high pageviews, but people spend an abnormally large amount of time on it?  Is it a popular entry page?  If so, where are they coming from?  A referral? A search engine?

What you do with this information can vary.  Maybe you highlight it on your homepage because you now know people are interested in it and you want to ensure that as many people know about it as possible.

Maybe you add some promotions on that page in hopes of more sales.  You could drive people from it to a tailored sales landing page that is explicitly written for someone who just read that high pageview page.  From here you’ll be able to track your web analytics goals.

  • Tagging your footprints.  Maybe you’ve found that certain domains are driving traffic to your site.  And maybe those are sites you are actively participating in, like Facebook, LinkedIn, Twitter referrals.  Especially if you have multiple links on those sites you should tag them appropriately and peel another layer back to see more detailed forensics into how your other web presences are performing.

Why Use Web Analytics?

While these reasons are strong enough on their own, they aren’t the types of reasons that convince most people to answer the question “Why use web analytics?

I find many times you either need to convert them into being a believer in the concepts of tracking data as a foundation to better decision-making.  Or you just need to go behind their back and do it yourself without permission.

How do you exclude yourself from Google Analytics or Omniture SiteCatalyst?

Google Analytics Exclude YourselfLast year I blogged on excluding yourself from web analytics reporting.  In particular, I dove into how to manage large numbers of IP addresses in your exclude filters for Google Analytics.  But the landscape has changed since then.  Now the methods need to be tweaked and there are some gotchas worth sharing on how to exclude yourself.


Depending on the size of your company, or more importantly the visitorship of your websites, the impact of internal visitors to your reporting could be huge and misleading.

Even for some of my tiny sites where I’m looking for traction in the early stages of life, I don’t want my footprints to be muddying up my web analytics.

Fortunately most web analytics packages allow you to remove, or at least hide, yourself and your visits.

When I refer to “my footprints” I’m really talking about me, my company, my client’s staff maybe even vendors.  Anyone that would be considered “internal traffic”.


The two most common methods for excluding yourself from your web analytics reports are: cookie-based and IP/domain exclusion.  There are pros and cons to each and that’s why Google Analytics and Omniture’s SiteCatalyst leave the decision up to you by providing you both options.

Cookie-based Exclusion

  • PROS:
    • For mobile computers or computers that regularly connect via dynamic IP addresses, this is the only method that works.
    • If there are devices on the same IP (not internal IP, but rather Internet-facing IP) as you then again you have to use cookies
  • CONS:
    • If your machine or software regularly deletes cookies (browsers can be configured to do this on closing) then you will need to continually re-add the cookies
    • Once a visit has been excluded via cookies, they cannot be retrieved.

IP/domain Exclusion

(Domain names just resolve to an IP address so they are lumped together for this purpose)

  • PROS:
    • If you do not have the ability to place cookies on the target devices (too many or remote) then you will have to exclude them via IP addresses or domains
    • You can use the filter on some profiles and not others. This allows you to have some reports with internal traffic excluded and others with the internal visitors included.
  • CONS:
    • You may not be able to inventory each and every one of your IP addresses, therefore leaving you open for contaminated web analytics reports.

Current Techniques

For Google Analytics, you need to go to your setup view and click on “Filter Manager >>”

Google Analytics Filter Manager

Google Analytics Filter Manager - Click To Enlarge

From there click on “Add Filter”

Google Analytics Add Filter

Google Analytics Add Filter - Click To Enlarge


There you will name the filter “Home Router” or “Corporate Office IP”, choose “Predefined Filter” and choose to either exclude based on IP address or domain.  It’s that simple.

Google Analytics Filter Types

Google Analytics Filter Types - Click To Enlarge

If you need to exclude many IP addresses, you need to dive into regular expressions which then lead you to the 225 character maximum and custom filters.  It’s not hard, but it’s also not 5 minutes of work.  I’ve built custom filter lists numbering over 30, encompassing over 200 IP addresses.  Fun times!


Here you’ll need a custom filter that Google has done a great job of explaining it in detail.

Google Analytics Cookie Filter

Google Analytics Cookie Filter - Click To Enlarge

Note the code needed on the exclude.html page had been updated with the latest asynchronous Google tracking code snippet.  Here’s the HTML code from a site that I have not yet upgraded to the latest code version.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Exclude Me</title>
<body onLoad="javascript:pageTracker._setVar('test_value');">
<p>This computer now has a cookie placed on it to exclude it from any Google Analytics reports.</p>
<p>If you delete your cookies, you will need to revisit/reload this page again.</p>

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-1111111-11");
} catch(err) {}

Update: Here’s how the code should look using the new asynchronous tag.  Note, I haven’t actually implemented this yet, but it’s pretty straightforward.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Exclude Me</title>
<body onLoad="javascript:pageTracker._setVar('test_value');">
<p>This computer now has a cookie placed on it to exclude it from any Google Analytics reports.</p>
<p>If you delete your cookies, you will need to revisit/reload this page again.</p>

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1111111-11']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


With Omniture’s SiteCatalyst, there may (and should) be a quicker way (please comment if you know it), but I manage it by logging in and going straight to “Exclude by IP”

Omniture SiteCatalyst Exclude by IP

Omniture SiteCatalyst Exclude by IP - Click To Enlarge


Here you’ll be able to add IP addresses one by one to your report suites.

Omniture SiteCatalyst IP Exclusion

Omniture SiteCatalyst IP Exclusion - Click To Enlarge

Two limitations: I don’t know of a way to add a domain exclusion, and if you want to exclude a large number of IP addresses, my Omniture account manager told me it would involve their professional services team ($$$).  I’ll have that need soon and I’m too stubborn to pay for something that should be free.


To enable cookie exclusion, on that same “Exclude by IP” you will see a very well-hidden link title “click here” (brilliant label) that will take your cookie “jar”.

Omniture SiteCatalyst Cookie Exclusion Option

Omniture SiteCatalyst Cookie Exclusion Option - Click To Enlarge

Here you’ll either see a button that says “Exclude” (your computer is not yet excluded and needs to have a cookie placed on it) or “Reactivate” (your computer already has the needed cookie placed on it).

Interesting!  When I went to take my screenshot I ran into an error.  I tried multiple browsers, report suites and computers.  For now you’ll need to trust me the button usually exists where “undefined” is below.

Omniture SiteCatalyst Cookie Exclusion Error

Omniture SiteCatalyst Cookie Exclusion Error - Click To Enlarge

A very big downside of Omniture cookie exclusion implementation is that you must log on to SiteCatalyst to place the cookie.  So you can’t have non-users just visit a page that places the cookie on their machine.  You have to either grant them access or log in yourself from their machine.


  1. Beware of automatic cookie deletions.
  2. Dynamic IP addresses, ISP changes and location growth can quickly invalidate your filters.
  3. Creating new profiles (Google Analytics) or report suites (SiteCatalyst) requires you to apply your chosen exclusion technique to them.  It will not occur automatically.

I hope this helps explain the two exclusion methods, two web analytics vendors’ implementation of those methods and a few of the hazards to avoid when implementing them.

Please leave comments if this was helpful (or not)!

ClickTale User Review

Is your website poorly performing? ClickTale will show you why
ClickTale is one of my Top 3 web analysis tools.  Its power and quick payoff are huge.  I wish I had more time to truly exploit it on a regular basis, I believe in it so much.

My Typical Use

When I’m first initiating a customer engagement after making sure they have basic analytics set up, I’ll install ClickTale on their site for 2 weeks.  During this time there will be no changes made to the site.  We’ll collect data on the users of the site in a way that is more advanced and telling than straight Google Analytics.

Here are the 3 features that have sold me on the product and make me fork over $99/month (this link will get you the Bronze Plan for $79/month):

Recorded User Sessions (Videos)

After you’ve tagged all pages of your site, you can literally watch one by one as your users move their mouse, type into your forms and click un-clickable images.  By the way, I love how they’ve coined them as videos, very approachable and easily understood.

In fact there is always at least one ah-ha moment within the first 5 sessions we review where we find a significant usability problem with the customer’s site.  As you present your proposal to a client, your VP or Marketing or your CEO, it’s always nice to know you can count on at least one instant win that sometime pays for all of your costs.

Once you’ve come down from the recording high, though, the filtering that you can do to focus on failures (see the jserror below), how different browser visitors experience your website and even engagement time, is where the tool really pays off.

ClickTale User Recording Video List

One of my favorite deep dives is to watch recording of users who came in through what I consider to be highly qualified organic search terms, but had very short (if not bouncing) visits.  I want to see their screen, watch their mouse move and attempt to put myself in their shoes to determine why they didn’t stay.

Mouse Move Heatmaps

This is total eye candy and one of the easy ways to win over those skeptical of your analysis.  Of course, you’ll need to follow-up with your hard core recommendations, but presentation is everything and heatmaps are a great first slide.

But these are not just static heatmaps.  And they really go beyond eye candy.  After two weeks of data you’ll know so much about how effective your web pages are that your client or boss will be converted and become engaged in learning more about how to improve your website.

You have to upgrade to the enterprise level to get heatmaps beyond just the one available in the Bronze package.  That package only maps your most popular page, usually the home page.  There’s a big jump in price beyond the Bronze package.  So I recommend starting with the Bronze package first to make sure it’s what you want.

But as you’ll learn, not only can you quickly see where the visitor’s mouse moves (with its 80% correlation to eye movement), but you can turn layers/filtering on and off to help you find what’s working and what may be causing confusion to your visitors.

Form analysis

This is another monster.  In addition to friendlier reporting on your conversion metrics, the tool, when combined with user recording, can really hone in on problems with forms.  Since so many of my clients are focused on lead generation, the completion of a form is the money shot.  Quickly finding holes in their lead funnels can justify months of future work looking for smaller lifts in conversions.

Form conversion report

Another Secret Weapon

I would probably pay the $99/month (discounted Bronze Plan for $79/month) for just these 3 features.  They are that empowering.  Other features of the Bronze package that I use less include:

  • Scroll reach heatmaps
  • Up to 3 domains tracked – perfect number for me
  • Click heatmaps
  • Link analytics
  • Event-based filtering
  • Custom email alerts

SPY on your Visitors

3 Powerful Conversion Rate Analyses, Courtesy of Your Web Analytics


Let’s pick apart three powerful conversion rates that I have been using web analytics to do deep dives with one of my customers.

Avinish Kaushik, years ago, shared his views on how to consider conversion rates and what not to do.  From his position these metrics may be too granular, but for my customer and me they are invaluable in learning more about how the website is used and what works for the visitors.

You are more than welcome to disagree, but that’s doesn’t mean they aren’t valuable!

Assumption: You have goals defined in your web analytics tool.  I use Google Analytics for this customer because they weren’t able to invest in Omniture’s SiteCatalyst.

I have micro-goals (7.0 Pages per Visit and 4.0 Minutes per Visit) as well as harder, more traditional goals (Form completions and Dynamic Phone Number Tracking) since my customer works in a B2C lead generation model where the sale is completed over the phone.

So here they are.  My 3 Powerful Conversion Rates

Blog visitor conversion rates

Using Google Analytics’ Advanced Segmentation I pulled out those visitors whose first page on their visit to our website (Content – Landing Pages in the Google Analytics world) was within our website’s blog section.   I’m showing their source/medium here for additional insight since many readers do not often get to peak into any firm’s web analytics data.

Blog Visitors Conversion Rates

These folks are interesting because the content of the blog is not lead generation material, but rather thought leadership and subject matter expertise in nature.

And as you might expect, they’ve done well on the soft goals over the past 3 months, but their conversion rate on the more important hard goals of form completions are near zero.

Keyword conversion rates

Here we are back to looking at the entire visitor population at large via web analytics.

Keyword Conversion Rates

What’s interesting here is the comparison of the soft goal conversion rates compared with the earlier example of blog visitors. You’ll notice the blog visitors were much more inclined to visit more pages and spend more time on the site than some of the search-based keyword visitors.  Note that we had no paid search going on during this window, so we are only considering organic searchers.

But you will notice that the hard conversion rates jump significantly for a handful of keywords.    It’s worth noting that 3 of the top keywords that have been blurred out are branded keywords and have higher conversion rates as expected.

That would be worth another look to see how your branded keywords perform against your non-branded keywords.  Through segmentation you could easily put those two groups side-by-side.

Mobile device conversion rates

With the recent launch of the iPad I personally like to track this conversion rate to see how it measures up against the others.

Mobile Visitors Conversion Rates

Since this customer’s site has not yet been converted/adapted for the mobile devices you can see that overall it is performing miserably with them.  Aside from the iPad and Samsung, our soft goals are near zero.

An interesting side note on these data points, those two operating systems had screen resolutions of 768×1024 and 231×264, respectively.  I find it odd that such a small resolution on the Samsung would generate high soft conversion rates.  To investigate another day.

The Missing Power Conversion Rates

I, personally, dissect conversion rates many different ways with a majority of them proving useless.  It’s not until you find that handful of enlightening views, which always differ by customer, that you take a leap forward in improving their visitor experience while also providing that conversion rate lift that your customer is constantly seeking.

But if you’re into that level of detail, combined with knowing what affects the business, you’ll get closer to that elusive title of digital strategist, marketing technologist or just plain online marketing fanatic.