Skip links

Tracking WordPress 404 Errors in Google Analytics

Want a quick way to get hold of all those missing pages on your WordPress website?

Between WordPress and Google Analytics GA4, this is simple.

Well, you know, considering it’s GA4 🙄

When you hit a 404 error (page not found), WordPress sets the page title to Page not found – Name of your site. This is great because, in Google Analytics, you can create a report by using page titles.

Creating a 404 Error report in Google Analytics GA4

Creating the report is the tricky part. But the good news is that this is a one-time thing, and you can just save it for next time.

In Google Analytics, open the Explore screen and create a blank report.

Google Analytics add Free Exploration Report

Then in the variables tab, click the “+” sign next to “Dimensions”. We want to add the Page Title and Page Location dimensions. You can use the search to locate them. Click Import once selected, and then click the “+” sign next to Metrics.

We want to add the Event Count metric.

Adding custom metrics and dimension to report

Now drag the Page Location dimension and drop it in the Rows section (to the right).

Then, drag the Event Count metric to the Value section (below rows and columns).

Using filters for Google Analytics report

As you can see, this will show you all of your pages, but we only want pages with a 404 error (page not found).

To do this, drag the Page Title dimension to the Filters section. Then, in the Conditions, set it to “begins with” and set the expression to “Page not found”. Click “Apply” and view the report.