How to Track Error Pages (404 pages)
Pages regularly appear and disappear on websites, other websites may link to wrong URLs on your website, resulting in error 404 (page not found). To crawl such pages do the following:
- Set up a custom 404 page: You can do this easily if you use a CMS (e.g. in WordPress all 404 pages are loading a custom 404 template). If you don't use a Content Management System, you can usually specify a custom 404 page in the file web server configuration.
- Add MVMCloud Analytics tracking code to this custom 404 page. In the Javascript tracking code, add the following:
_paq.push(['setDocumentTitle', '404/URL = ' +
encodeURIComponent(document.location.pathname+document.location.search) +
'/From = ' + encodeURIComponent(document.referrer)]);
Before the line:
_paq.push(['trackPageView']);
- In your MVMCloud Analytics report, under Behavior > Page Titles, you will now have a new entry for 404 pages. It will also list the full URL of the 404 pages, as well as all referrers that link to this page.
For advanced reporting on your 404 error pages, consider the Custom Reports premium feature, which allows you to create a new report for 404 error pages. It allows you to analyze 404 reports faster and provides more insights.