How to track 404 error pages

Tracking your 404 error pages is a lifesaver for your web site. You can fix this errors very quick adding a simple code to your 404 page. Let’s move on.

I assume you have inserted our tracking code into your web page. If you have this still pending on your tasks, do it now before continue this guide.

  • Copy the following code
window.addEventListener('load', (event) => {
  pa.track({name: '404--> ' + document.location.pathname});

Paste it between <head> and </head> tags and save.

You are done! Now you will see all 404 errors listed on your pages tab and on your events tab.