How to track error pages (404 pages) in Piwik? Which URLs are 404 and which referers lead to these pages?

Piwik PRO enables you to track which URLs link to error pages (404 pages), and which referrer pages are leading to 404 on your website.

1. Configure a custom 404 page: it’s easy to set it up if you use a CMS (in WordPress for example, all 404 pages are loading a custom 404 template). In case you don’t use any Content Management System, you can define a 404 custom page in your web server configuration file.

2. Add the Piwik PRO tracking code in the defined custom 404 page. Implement the following script in the Javascript tracking code:

paq.push(['setDocumentTitle', '404/URL = ' + encodeURIComponent(document.location.pathname+document.location.search) + '/From = ' + encodeURIComponent(document.referrer)]);

before the line

_paq.push(['trackPageView']);

3. You will now see a new entry for the 404 pages in your Analytics reports, Actions -> Pages Titles. The report will also display the list of full URLs of the 404 pages and the referrers linking to this page.

Was this article helpful?

Be the first to rate this article.

Technical Support

If you have any questions, drop us a line at support_SPC@piwik_SPC.pro.

We’re happy to help!