Tracking 404 pages is key to your stores success. The reasons people arrive at error pages on your website are numerous – reasons range from outdated links to incorrectly shared links, to mistyped URLs. By tracking your 404 pages, you can quickly find other pages linking incorrectly to your website, and take action to ensure visitors arrive at the intended page.
The tracking code we will add to your 404 page will give you the following data for each error page:
- The referring website
- URL requested
With this data, you can either contact the referring website and ask that they update their link, or go into your Volusion store admin and create a 301 redirect (recommended).
Adding the Code
We assume you have already added Google Analytics tracking to your website and have already created a custom 404 error page. Note: You will need FTP access to your Volusion store. [How-To at Volusion]
Locate the file: 404.txt within /vspfiles/
and add the following code to the end of the document:
<script type="text/javascript"> _gaq.push(['_trackEvent', 'Error', '404', 'page: ' + document.location.pathname + document.location.search + ' ref: ' + document.referrer ]); </script>
Tracking 404 errors in Analytics
Give your website 2-3 days to collect data. When you login to Analytics, go to: Content > Events > Overview.
You will now have a clear picture of the most common error pages, and can take appropriate actions (if necessary) for each.