PrivateAnalytix Help
  • Get Started
    • Welcome
    • Register an account
    • Add your web site
    • Add the script to your website
  • Website Settings
    • Opt out and exclude yourself from the analytics
    • Set reports to be sent via email
  • Goal Conversions
    • Custom event tracking
    • 404 error page tracking
  • API for Developers
    • Statistics API
    • Websites API
    • Account API
Powered by GitBook
On this page
  • 1. Ensure that your PrivateAnalytix pixel is installed
  • 2. Add this piece of code to your 404 page header
  1. Goal Conversions

404 error page tracking

PreviousCustom event trackingNextStatistics API

Last updated 3 years ago

Hint

Please note that if you decide to use the 404 error page tracking feature, this will count towards your total monthly page view allotment.

Tracking 404 error page occurrences is essential for web site owners. You can track 404 pages in PrivateAnalytix, which will allow you to:

  • Get an easy overview of which pages have been triggered

  • Identify where visitors have experienced a broken page

  • Allows you to mitigate (fix) the broken page

If you want to track 404 errors on your web site, do the following:

1. Ensure that your PrivateAnalytix pixel is installed

Make sure that you have installed your PrivateAnalytix pixel code in the <head> of every page on your web site. Learn how to do it here.

It should look like so:

<script data-host="https://privateanalytix.com" data-dnt="false" src="https://privateanalytix.com/js/script.js" id="YOUR PA ID" async defer></script>

2. Add this piece of code to your 404 page header

Add the following code to the header (between <head> and </head> tags of your 404 page template.

<script>
    window.addEventListener('DOMContentLoaded', function () {
        pa.track({name: '404'})
    });
</script> 

Now, you will be able to see the number of 404 error page occurrences and the URL of the pages in your "Events" tab.

404 goal tracking