How to Find broken links in Google Analytics 4

With GA4’s custom reports, you can quickly find broken inbound links to your website. This guide will show you how to create the report and what to do next.

Broken inbound links are bad for your website's user experience and hurt your SEO performance. However, it's almost impossible to avoid some links getting broken after a while. Maybe you deleted pages, restructured your site, or changed your URLs. Other websites might still link to your old URLs, causing the broken links.

This is problematic for internal links, but especially for links from other websites to yours. Those hard-earned backlinks now take your visitors to a broken page. 

Thankfully, there's an easy fix for that! While you cannot completely avoid broken links, Google Analytics 4 custom reports can help you find and fix broken links.

In this guide, I’ll show you how you can create a custom GA4 report to find broken links. This trick has helped me find and fix many silly mistakes, so I’m sure it can do the same for you.

How to find broken inbound links

We’re going to use Google Analytics 4’s custom reporting features to find out which links to our website result in a 404 page.

There are 2 prerequisites before we can use Google Analytics to fix links:

  • You need access to the Analytics account and permissions to create a custom report
  • Your 404 pages should have a distinct, recognizable title. Something like “Page not found” will do.

Got that sorted? Great, follow these steps and you’ll be fixing 404s in no time.

Set up the broken links report in GA4 manually

Set up the report yourself by completing the following steps:

  • Go to the GA4 Reports section in the left-hand sidebar 
  • Go to the Engagement section
  • Click “Pages and screens”

pages and screen

Select the “Page path and screen class” primary dimension and click on it to change it to “Page title and screen name”

page title and screen name

Click the + sign next to “Page title and screen name” to add the secondary dimension (type it in): “Landing Page + Query String”

page title and screen name 2

In the search bar, type in the name of your 404 page. In our case, it’s “Not Found.”

This will show you a full list of pages with broken links!

Why am I not seeing anything?

If you're not seeing any broken links, verify that you’ve entered the exact page title in the filter field. Otherwise, it won’t work. 

And if you haven’t made any big changes to your site URLs recently, it’s possible there are no broken links. You can always double-check with SiteGuru’s broken link checker. 

Bonus: Finding Pages Referring to Your 404 Page with GA4

If you want to learn which pages sent the users to the broken pages, use the Exploration feature:

  • Create a new Exploration
  • Add the following dimensions: Page title and screen class, Page referrer, and Page location
  • Select all 3 and import them

variables

  • Add the following metrics: Event count, Active users, and Sessions
  • Select all 3 and import them
  • Move the Dimensions into Rows and move the Metrics into Values to see them in your report


broken links report 5

  • Filter for error pages by selecting conditions: “contains” and “[Your Error Page Name]”


broken links report 6

And your Exploration to find broken links and their referring pages will be ready! 

How to fix broken inbound links

We have now found all pages that get linked to from other websites, but result in a 404 page. 

There are a few ways to fix those broken links:

  • Ask the webmaster of the website that links to the erroneous page to update the link. It’d be great if they could do that, but it’s time-consuming and there’s no guarantee they’ll respond. Luckily, there’s an easier way!
  • Create a 301 - permanently moved redirect. This takes your visitors to the correct URL. As a bonus, Google and other search engines will realize that the page has moved and will attribute the SEO value of that link to the new page. And that’s exactly what we want!

After you’ve set up those redirects you should see a steady decrease of 404 entrances in the report. Keep reviewing the report on a regular basis to track your progress.

Pro-tip: Schedule the broken link reports 

If you want to stay on top of broken inbound links, go to your report. Then, click the share icon and select the option to “Schedule email.”

You can choose the frequency and other details so the report lands in your inbox when you want it. Now, you’ll make sure no broken link slips through the cracks!