Ralph van der Pauw

  • Home
  • Ralph
  • Digital Analytics
  • Customer Experience
  • SEO
Error Pages & Google Analytics [UPDATE]

Error Pages & Google Analytics [UPDATE]

  • 27/03/2012 | By: Ralph | Categorized: Digital Analytics | Social: Share

Yesterday I wrote about tracking error pages with Google Analytics _trackEvent. I suggested _trackEvent over _trackPageview for it has the ability to add different dimensions to the event and you wouldn’t want 404 pages to increase your pageview count. Tim (Leighton-Boyce) pointed out that a 404 is part of the visitor session, you should be able to track if people bounce on 404 or click through on suggested links or perhaps even use a search box. A very fair point and I stand corrected. I would definitely add the _trackPageview line to the GA tracking code.

Goal Tracking
Having a short discussion on the topic, Tim stated: “Why not use goal tracking for the 404′s?” – Yeah, why not? Goals not only offer valuable metrics such as the conversion rate, but also valuable insights such as the reverse goal path and intelligent alerts . Tim was unsure about tracking the events to use the reverse goal path report, but I can verify this is possible. This way you are able to point out the path which led to the 404. Some amazing stuff!

Goal tracking for the Error pages in Google Analytics

So get your ‘track’ on and start tracking your 404′s with pageview and event-tracking. Make sure you link those events to a goal type. I’ve personally set up an complete error profile to experiment more with Tim’s suggestions combined with the event-tracking and I’ll see if it will acquire some valuable new insights. The new tracking cookie for tracking the error pages would look like this:

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackEvent', 'Error', '404', 'page: ' + document.location.pathname + document.location.search + ' ref: ' + document.referrer, true]);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// ]]></script>

Good luck and big thanks to Tim for the new insights!
If you have any new ideas, please so share them with me in the comments!

Update: We just keep customizing the code! André Scholten suggested the use of the noninteraction parameter in _trackEvent. This way the event is excluded from bounce-rate calculations and does not affect your bounce-rate. It’s set by adding the parameter  ’true’ at the end of the trackevent, as in the example above. Thanks André!

Tweet

11 Comments

  1. André Scholten
    27/03/2012

    The same comment here as well: 
    You could add an extra “true” parameter to the call so the event won’t count as a user hit, and doesn’t affect your bouncerate.

    Reply
    • Ralph van der Pauw
      27/03/2012

      Thanks André, that’s a very good suggestion. The noninteraction parameter, I forgot about that one!

      Reply
      • André Scholten
        27/03/2012

        So now you have to write another update ;)

        Reply
        • Ralph van der Pauw
          27/03/2012

          Damn you! ;) Fixed!

          Reply
  2. Tim Leighton-Boyce
    27/03/2012

    This is great to see. Thank you for sharing the code here and on your previous post. I’ve found tracking 404s to be very valuable over time. It’s not a very exciting metric. But it makes a big difference to people visiting sites.

    Reply
    • Ralph van der Pauw
      27/03/2012

      Well said Tim, it has an impact on the user experience as well as the strength of your (SEO) linkstructure. Definitely something to track and take into account!.

      Reply
  3. Gerry White
    27/03/2012

    Wow – I have always just taken the surprisingly lazy method of page title, making sure the page title is distinct allows you to go through the page titles report and seeing a list of all the 404 pages, it also gives you pathing, referalls etc.. which I am not sure track event will … 

    Oh and create a tech / error dashboard which also includes page load speeds etc.. for various areas …!

    Reply
    • Ralph van der Pauw
      27/03/2012

      Thank you Gerry! The 
      ‘page: ‘ + document.location.pathname + document.location.search + ‘ ref: ‘ + document.referrer
       line makes it possible to have both the page and the referal in an event-variable. :)

      I totally agree about the dashboard. Currently I am experimenting a lot with page load speeds and a custom dashboard has been a very helpful tool.

      Reply
  4. Marine Pina Urrútia
    21/04/2012

    A very impressive article. Well prepared. Very motivating!! Go off on to facilitate way

    Reply
  5. Michael Hayes
    13/05/2013

    Great article, but you’ve created a new error by adding the non-interaction parameter to the event, as before it there should be a value parameter (e.g. 0)

    Reply
  6. Ralph
    13/05/2013

    Hi Michael,

    The developer documentation states that the _trackevent command requires a boolean:
    https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
    Did you had problems setting it up?

    Reply

Leave a Reply

Cancel Reply

Topics

  • Digital Analytics
  • Social
  • SEO
  • Customer Experience
  • Performance
  • Marketing Research

Social Links

  • @vanderpauw
  • LinkedIn
  • +Ralph van der Pauw

Also worth reading:

  • Top 10 Twitter influencers in Search and Social for 2010
  • The importance of a Google+ Marketing Strategy
  • SEO, You'll Feel the Pain Afterwards
  • How to gzip your CSS stylesheets with PHP
  • How to add expire headers to my images and sheets

© 2013 Ralph van der Pauw All Rights Reserved.

Sitemap