A line chart that is only decorative for the page

404 Logging with Google Analytics

February 15, 2020 by adkvolks

Lets get right to it. What we are going to do is setup two custom reports within Google Analytics with 404 reports from traffic within your website and traffic outside your website. This tutorial is going to assume that you have at least some familiarity with Google Analytics and you have a 404 page setup.

Log into Google Analytics and navigate to the account/view that you would like to setup the reports. Go to Customization -> Custom Reports and click create “New Custom Report”.

  • Title: 404 Errors from Internal Links
  • Type: Flat Table
  • Dimensions: Page, Previous Page Path, Page Title
  • Metrics: Unique Pageviews, Pageviews
  • Filters:
    • Exclude, Previous Page Path, Exact (entrance)
    • Include, Page Title, Regex, Page Not Found
Screenshot of Google Analytics Custom Report screen.
Google Analytics Custom Report

Save this report and create another custom report with the following options:

  • Title: 404 Errors from External Links
  • Type: Flat Table
  • Dimensions: Page, Full Referrer, Page Title
  • Metrics: Unique Pageviews, Pageviews
  • Filters:
    • Include, Previous Page Path, Exact (entrance)
    • Include, Page Title, Regex, Page Not Found
Google Analytics screenshot of custom report.
Google Analytics Custom Report

The only part from the instructions above that you may have to tweak is the list line of each of the reports under the Filter -> Include, Page Title, Regex, Page Not Found. You will need to change the “Page Not Found” to Page Title of YOUR 404 page.

You now have two custom reports, internal and external links, that will show you what URLs that users are hitting your 404 page with. And where they are coming from.

For extra credit, you can now setup a scheduled email for these reports to email you once a week, month or whatever your preference is.

Jonathan Volks - face in black and white
Jonathan Volks

Back-End Web Programmer and Front-End Developer

Currently an Associate Director of Web Programming and Design at Skidmore College. Jon has been a back-end programmer and front-end developer for over 15 years working with marketing departments on various types of websites. Follow me on Instagram: @adkvolks