How to Find 404 Errors in Google Analytics 4
Nothing's more frustrating for a website visitor than clicking a link and landing on a "Page Not Found" error. It breaks their journey, damages their trust in your site, and often sends them clicking the back button for good. This article will show you exactly how to find these pesky 404 errors using Google Analytics 4 so you can fix them and improve your user experience and SEO.
Why Tracking 404 Errors is a Big Deal
You might think a few broken links aren't a major issue, but they can cause a cascade of problems for your website. Ignoring them is like leaving potholes on the path to your front door - some people might navigate around them, but many will just give up and go elsewhere.
- Poor User Experience: The most immediate impact is on your visitors. They were looking for something, and you didn't deliver. This friction can lead to frustration, higher bounce rates, and a negative perception of your brand.
- Lost Conversions & Revenue: If a link to a key product page, service page, or contact form is broken, you're directly losing potential leads and sales. You could be spending money on ads that send traffic straight to a dead end.
- Wasted SEO Efforts: Search engines like Google have a "crawl budget," a finite amount of resources they allocate to crawl your site. If the Googlebot is constantly bumping into 404 errors, it's wasting its budget on dead pages instead of indexing your new and important content. Furthermore, if other websites link to a page on your site that is now a 404, you lose all the SEO value (or "link equity") from that valuable backlink.
Consistently monitoring and fixing these errors shows both users and search engines that your site is well-maintained, reliable, and worthy of their attention.
Method 1: The Quick Check Using Page Titles
If you need a fast and easy way to see if 404 errors are a significant issue on your site, you can do a quick check right inside your standard GA4 reports. This method works because most websites use a consistent page title for all their 404 pages, such as "Page Not Found," "404 - Not Found," or something similar.
This approach isn't perfect, as its accuracy depends on your website having a unique and consistent title for its error page, but it's a great starting point.
Step-by-Step Guide for the Quick Check:
- Navigate to the 'Pages and Screens' Report: From your GA4 dashboard, go to Reports > Engagement > Pages and Screens.
- Change the Primary Dimension to 'Page Title': By default, this report shows the "Page path and screen class". Click the small dropdown arrow next to the primary dimension and change it to 'Page title'.
- Search for Your 404 Page Title: In the search box just above the table, type the title text that appears on your 404 error page. Common examples include "Page not found," "404 Error," or "Not Found." Hit enter.
If you have any 404 errors, they will appear in the filtered list. Now you know that an error is happening, but you still need to know what specific URL is broken.
Finding the Broken URL
Once you've filtered your report to show only your error page title, you can add a secondary dimension to see the specific broken URLs that visitors are landing on.
- Click the blue "+" icon next to the primary dimension dropdown ('Page title').
- Under the 'Page / screen' section, select 'Page path and screen class'.
Now your report will show a list of all the broken page paths that are triggering the "Page Not Found" error. This list is your action plan - these are the URLs you need to investigate and fix.
Method 2: A Better Way with a Custom 404 Event
While the page title method is good for a quick spot-check, the most robust and accurate way to track 404s is by creating a dedicated custom event that fires every time a visitor hits a 404 page. This gives you cleaner data that you can easily use to build custom reports and alerts.
This method requires using Google Tag Manager (GTM), which is the standard for managing tags and tracking scripts. If you don't already have GTM set up, it's well worth the initial effort for the powerful tracking capabilities it unlocks.
Step 1: Create a Trigger in Google Tag Manager
First, we need to tell GTM when to fire our event tag. The best way to do this is to create a trigger that activates only when a 404 page is viewed.
- Log into your Google Tag Manager container and navigate to the Triggers menu on the left. Click "New."
- Name your trigger something descriptive, like "Event - 404 Page View."
- Click on "Trigger Configuration" and select the Page View trigger type.
- Under "This trigger fires on," select Some Page Views.
- Set the firing conditions. The most reliable condition is often the unique page title of your error page. Set the conditions to fire when: Page Title | contains | Page not found. (Note: Adjust "Page not found" to match the exact title of your 404 page).
- Save your trigger.
Step 2: Create the GA4 Event Tag in GTM
Now that we have our trigger, we'll create the GA4 event tag that it will fire. This tag will send the 404 data over to Google Analytics.
- Go to the Tags menu and click "New."
- Name your tag something like "GA4 - 404 Error."
- In the "Tag Configuration" box, select Google Analytics: GA4 Event.
- For the "Configuration Tag," select your existing GA4 base configuration tag (the one you use to send all your other GA4 data).
- For "Event Name," type in
error_404. This is the name that will show up in your GA4 reports. It's best to use lowercase letters and underscores (snake_case) for event names. - Expand "Event Parameters" and click "Add Row." We want to capture the specific URL that caused the error.
- In the "Triggering" section at the bottom, select the "Event - 404 Page View" trigger you created in the previous step.
- Save your tag.
Finally, remember to Submit and Publish your container to set your changes live. It's always a good practice to use GTM's "Preview" mode first to test your new tag and trigger on a known broken URL to confirm it fires correctly.
Step 3: Register Your Custom Dimension in GA4
We're almost there! We've told GTM to send the broken URL (page_path) along with our error_404 event. But GA4 won't know what to do with that extra piece of information until you tell it. This is done by registering it as a "custom dimension."
- In GA4, go to the Admin section (the gear icon in the bottom left).
- Under the "Data display" column, click on Custom definitions.
- Click the "Create custom dimensions" button.
- Fill out the details:
- Click "Save." It can take up to 24-48 hours for new custom dimension data to start appearing in your reports.
How to Report on Your New 404 Error Event
Once your new event is configured and has had some time to collect data, you can build much more useful reports.
Creating a Custom 'Explore' Report
The "Explore" section of GA4 gives you a powerful, flexible canvas for building custom reports from scratch. This is the best place to analyze your 404 error data.
- In GA4, click on Explore in the left-hand navigation and start a new "Blank" exploration.
- Name your report something clear, like "404 Error Report."
- Add Dimensions: In the 'Variables' column on the left, click the "+" next to Dimensions. Search for and import your new custom dimension (e.g., "404 Error URL") and other dimensions you might want, such as "Page referrer" or "First user source / medium."
- Add Metrics: Click the "+" next to Metrics. Search for and import "Event count."
- Build the Report:
- Filter by Event: At the bottom of the 'Tab Settings' column, find the 'Filters' box. Drag the 'Event name' dimension here, set the logic to "exactly matches," and enter
error_404. This ensures your report only counts events from your 404 tag.
You will now have a clean, sortable report showing every broken URL and a count of how many times visitors have landed on it. You can sort by event count to see the most problematic URLs first. Adding "Page referrer" as a secondary dimension can show you which external sites are linking to your broken pages, and "First user source / medium" can tell you which channels (organic, paid, social) are sending traffic to them.
You Found the Errors - Now What?
Finding the errors is the essential first step, but the real value comes from fixing them. Your primary goal is to ensure a user trying to reach a piece of content gets to the right place or a useful alternative.
- For Internal Links: If a link from one of your own pages to another is broken, that's your top priority. Find the incorrect link on the referring page and update it to the proper URL.
- For External Links or Old URLs: If an old page was deleted or moved, or if another website is linking to a non-existent URL, you should implement a 301 redirect. A 301 is a permanent redirect that automatically sends users and search engines from the old broken URL to the new, relevant page. This preserves the visitor's journey and passes along most of the SEO value from the old link to the new page.
- Create New Content: If a broken URL is getting a lot of traffic from external sources because people are hoping to find a specific type of content there, consider creating a new page on that topic to satisfy their search intent.
- Sometimes, It's Okay: If a URL truly never existed, has no valuable backlinks pointing to it, and gets very little traffic, it's perfectly fine to let it remain a 404. It's the important pages that go missing that you need to worry about.
Final Thoughts
Tracking 404 errors in GA4 is a critical part of maintaining a healthy, user-friendly, and SEO-optimized website. Whether you're doing a quick check using page titles or setting up a robust custom event, staying on top of these broken links will help you capture otherwise lost traffic and conversions.
Creating custom reports and analyzing data from disconnected sources like Google Analytics can be time-consuming. At Graphed, we've automated this process away. We connect directly to your data sources - like Google Analytics, Google Ads, Shopify, and more - and allow you to create powerful dashboards and get instant answers simply by asking questions in plain English. Instead of spending hours in the GTM and GA4 interfaces, you can just ask, "Show me my top 404 pages this month by traffic source," and get a report in seconds, freeing you up to focus on fixing the issues instead of finding them.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.