How can I track 404 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( + '/From = ' + encodeURIComponent(document.referrer)]);

before the line


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?

of people found this helpful

Technical Support

If you have any questions, drop us a line at

We’re happy to help!