errr-ROAR pages

homer-simpson-doh

errr-ROAR pages

homer-simpson-dohSo I want a tidy way to track error pages in google. Seems like that would happen by default right?

So how about a nice way to see the host, full referring path, and the attempted destination? Then you can make a report and send it over for someone in content editing to deal with it.

Here is what I did.

1. Create a Google Tag Manager account. See here for questions.
2. Create your Google Analytics account for your error pages only.
3. Create a container in GTM. Then use the ‘Custom HTML Tag’ option and insert the following…

<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-X']);
_gaq.push(['_trackPageview', document.location.href + 'LinkLocation=' + 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’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

 

4. Obviously you need to replace the XXXXXX-X with your own GA code.

5. Don’t forget to fire this on all your pages and add the container to any other error pages.

So what do you get in the end?

6. Head over to your Content Overview page. Content – Site Content – Pages and look at those URLS. Very interesting huh. How add the secondary dimension of host to see where that’s coming from if you are using this error page on multiple different domains.

Your Content Page URLs will look like this…

https://www.yourdomain.com/index.cfm?PID=404&ErrorPage=great-software/LinkLocation=http://yourdomain.com/types-of-software

It will be your job to disect the URL and take care of fixing the errors. Here is the breakdown.

all is well with our analytics

all is well with our analytics

- Ignore the first part… https://www.yourdomain.com/index.cfm?PID=404

- Here is destination url which was bad: &ErrorPage=great-software/

- Here is the location where you’ll find that bad link: LinkLocation=http://yourdomain.com/types-of-software

You may want to go ahead and create a handy custom report so that you can always just click on it.

 

It makes me very happy to see a peaceful error report. :) After you take care of those bad links, it’ll be great. Imagine having this setup once you start a site migration. You might tear your hair out, but atleast you KNOW it’s happening!

 

 

2 Comments
  • Priscilla Decker
    Posted at 14:43h, 07 June Reply

    Finally, there doesn’t seem to be an easy way to create language/locale specific error pages but you can create your custom skin templates in your store’s main language.

  • Mark Q. Miller
    Posted at 14:23h, 20 June Reply

    attribute. You can even have multiple custom error pages for different HTTP error statuses.

Post A Comment

Protected by WP Anti Spam