A 404 error, often shown as a Page Not Found message, occurs when a user tries to visit a webpage that no longer exists or can't be found on the server.
404 errors are frequently caused by incorrect URL or a page that has been deleted or relocated without proper redirection.
High numbers of 404 errors might make it difficult for search engines such as Google to index your site.
When users come across a 404 error, they are unable to access a page, which may lead them to seek info on a competitor's website.
In addition to impacting user experience, 404 errors can have a negative impact on your website's SEO.
It's important to know why these errors happen and how to fix broken links to keep your website user-friendly. This guide will show you how to find pages with 404 errors using Google Analytics 4 (GA4) and provide suggestions to fix them.
🚨Keep in mind that GA4 only shows broken links that were clicked on because it is based on website behavior. If someone have never clicked on it, it won't show up.
How to Track 404 Errors in Google Analytics
You can track and analyze 404 errors using Google Analytics 4 in a few ways: by checking engagement reports, exploring reports, or using Google Tag Manager to send custom events.
We'll go through the methods using the GA4 interface.
Identify 404 Errors in Page Titles
To start, you can manually test for a 404 error by typing a URL that doesn’t exist on your website and see how your site responds.
For example, when you try accessing https://analyzify.com/test1 , it’ll lead to a 404 Page Not Found error message because the page doesn't exist.
It’s important to test for 404 errors on your website as the message might differ. For example, another website might display Page Unavailable in the page title like Google Merchandise Store:
Simply hover over the tab in your browser to determine its exact title. Once you identify the error by its title, GA4 can provide a detailed report of all 404 pages.
Find Broken Links w/ Pages and Screens Report
Follow these steps to view broken link URLs with default engagement reports.
Navigate to the GA4 Reporting section. Click on Engagement > Pages and Screens.
Change the primary dimension and choose Page Title and Screen Name.
Click on the plus button to add a new dimension, then type and select Landing Page + Query String.
On the search button, type your error message. In this example, we're looking for "Page Unavailable". Then you will see all pages that contain 404 errors.
Here's your report with 404 error pages with URLs.
Track 404 Errors w/Exploration
GA4 explorations allow you to add many dimensions and metrics together. For our example, we'll use Page Location (to identify the full URL where the errors occur) and Page Referrer (to identify which page visitors were on before landing on the error page).
Finally, we need the Page title and screen class to locate error pages in GA4.
For more detailed report to find error pages, let's create an exploration.
Go to Explore section and create a blank report.
Click on the + button and type these dimensions: Page title and screen class, Page referrer, and Page location. Choose all of them, and then click Import.
Click on the + button near the metrics and find these: Event count, Active users and Sessions. You can add more based on your wishes. Please don't forget to import them.
To be able to view those dimensions & metrics in your report, you need to double-click all of them (or you can drag them into Rows & Values.
Now you see a list of page URLs, so you need to filter your data to identify 404 errors. To do that, move the "Page title and screen class" dimension into the Filters section. Fill out the conditions as "contains" Page Unavailable. Then, Apply the filter.
Congrats! Here's your custom report to track broken links with Google Analytics 4: