Strategic Digital Marketers

Call us today on: 0207 607 5650

  • 4ps Blog



Home Blog Tracking Custom 404 pages in Google Analytics
21 January 2013

Tracking Custom 404 pages in Google Analytics

It’s never a good thing when visitors to your website land on a 404 page. It can have an impact on conversion data, as well as decrease the chances of visitors returning to your site. On the other hand, if a 404 page isn’t set up in the first place then you are at risk of damaging your brand’s potential for online traffic, not to mention the brand itself.

As Strategic Digital Marketers, we always advocate 301 redirecting a 404 page to the most relevant content for that page. This will then transfer the power built up in the 404 page to the URL which has been identified as having the most relevant content to suit the search requirements of the user. However, the question you may want to ask yourself is “How do we ensure that we know when a page has a 404 error?” You may answer that question with “Well, we can always check Webmaster Tools.”  Agreed.  But what if the 404ing page is not a crawlable page? 404 pages can be created when someone shares a page on Twitter, for example, or via an e-mail.  Google will not be able to crawl the page in these instances.

So what’s the solution?

By using event tracking, we are able to see the 404ing URL, the source and the keyword that the visitor came through to get to that page. If there is no 301 re-direct or if the keyword search volume is significant, then you may be justified in having a specific page for users coming to the website through that particular source. Still with me so far?

The next step is to put the tracking in place to serve these requirements. This will allow us to see which pages are 404ing in Google Analytics.

The code can be implemented within the <body> tag in the page source.

Script:

<script type=”text/javascript”>

var strPage = document.location.pathname;

var pageTracker = _gat.getTracker(“UA-*******-*”);

pageTracker._trackEvent(“Errors”,”404″,strPage,1);

</script>

The element above tells the search engines 3 things:

1. var strPage = document.location.pathname; – This tells Google the naming dimensions of the page to be included within the report i.e. URL, Keyword.

2. var pageTracker = _gat.getTracker(“UA-*******-*”); – This ensures that the events are recorded within the correct Google Analytics profile

3. pageTracker._trackEvent(“Errors”,”404″,strPage,1); – These are the event parameters that need to be shown within the Events report in Google Analytics. This will ensure that the URL and page dimensions are pulled into the report.

How this can be reported in Google Analytics

Tracking 404s in Analytics Example

As a SEO Agency we ensure that we monitor the frequency of visits to 404 pages to ensure that the website is not punished for serving users with inappropriate content. It also allows us to see which areas of the website could benefit from additional content as well as possible keyword opportunities.

Let us know if you think this is important by commenting below. You can also meet up with us to discuss this in more detail by contacting us.

Save on Delicious
Categories: Blog

Written by James.Green

As Senior SEO Executive, James Green has a huge passion for the online industries and enjoys the constant changes and challenges that the industry presents.

More about James Green

Leave a Reply

 

Subscribe to BlogGet all of our latest industry tips by email

Newsletter



  • Newsletter



  • Cookies Information:

    This site uses cookies and other technologies to help us understand how you use our site. By continuing to use this site, you consent to these cookies being installed on your computer. They are anonymous and no sensitive information is stored. For details on these cookies and technologies and how to disable them, please see our Cookie & Privacy policy at the bottom of the page.