Identifying broken links on your website is crucial for maintaining a positive user experience and optimising SEO performance. While Google Analytics 4 (GA4) doesn’t directly highlight broken links, it provides tools to detect them by analysing 404 error pages and tracking user interactions. Here’s a step-by-step guide to finding broken links using GA4.
Step 1: Set Up a 404 Error Page Tracking Report
1. Ensure Your 404 Error Page Is Properly Configured
Your website’s 404 error page should have a distinct title or URL, such as:
Title: Page Not Found
URL: /404.html or similar
This is essential for GA4 to track these errors effectively.
2. Log in to Google Analytics 4
Go to your GA4 property.
3. Create a Custom Report for 404 Errors
Navigate to Explore in GA4.
Select Free Form to create a new report.
Set up your report:
Dimensions: Add the Page Title or Page Path.
Metrics: Add Event Count or Views.
Filters: Add a filter to include only your 404 error page. For example:
Page Title: Page Not Found
Page Path: /404.html
Step 2: Identify the Referrer or Source of the Broken Links
To find where users encountered the broken link:
Add the Page Referrer or Source/Medium dimension to your report.
2. Analyse the referrer data to identify which pages or external sites are leading users to the 404 error page.
Step 3: Set Up an Event for 404 Errors (Optional)
If you want to track 404 errors more precisely, you can create a custom event in GA4 using Google Tag Manager (GTM).
1. Create a Trigger in GTM
Open your GTM container.
Create a new Trigger:
Trigger Type: Page View.
Condition: Fire when the Page Path equals /404.html.
2. Create a Tag in GTM
Add a Google Analytics: GA4 Event tag.
Configure the tag:
Event Name: 404_error.
Include any parameters, such as page_path or page_referrer.
Assign the 404 error trigger to this tag.
3. Publish Your Changes
Test the tag in preview mode to ensure it fires correctly on the 404 error page.
Publish the container changes.
Step 4: Analyse the 404 Errors in GA4
Go to Explore and filter by your custom event (404_error).
Look at key metrics, such as:
Page Path: Identify which broken URLs are generating 404 errors.
Referrer: Understand where users are coming from.
Device: Determine if the issue is device-specific.
Step 5: Take Action on Broken Links
1. Fix Internal Links
Use the referrer data to identify and correct internal links leading to 404 errors.
2. Update External Links
If the broken links come from external websites, contact the site owners to request updates.
3. Redirect Broken Pages
Set up 301 redirects for any pages with broken links to guide users to the correct destination.
4. Monitor Continuously
Regularly review your 404 error tracking report to identify new issues.
Tips for Better Broken Link Management
Use Enhanced Measurement: Ensure that Page Views are tracked correctly in GA4 for accurate reporting.
Leverage URL Parameters: Add custom parameters to your error page URL to track specific broken links.
Combine Tools: Use additional tools like Google Search Console or third-party crawlers (e.g., Screaming Frog) to complement GA4’s insights.
Conclusion
While GA4 doesn’t explicitly highlight broken links, its robust reporting capabilities can help you identify and address 404 errors effectively. By setting up custom reports, events, and triggers, you can maintain a seamless user experience and improve your website’s performance.
Need help setting up custom GA4 reports or troubleshooting broken links? Metric Labs specialises in advanced tracking and analytics solutions. Contact us today!
Like this blog post?
Sign up to our email newsletter – Lab Report – and never miss a new one!
Share this post
Say hello
Let us know a little bit about you and your business, and we’ll get back to you.