Modern websites commonly use 404 pages to let users know that the requested page is not found. This can happen if the page was deleted without a proper redirect, a broken link exists or if the visitor typed the wrong URL. You can use Piwik PRO to track 404 pages when the URL remains unchanged and shares a similar page title, like “Page not found | Clear Bank
.”
In this article, we’ll show you how to use segments and custom dimensions to analyze these 404 pages.
Analytics + segments
To find 404 pages on your website, follow these steps:
- Find the page title of your 404 page and look for the part that remains unchanged. Example:
Page not found
or404 not found
. - Go to Menu > Analytics.
- Create a new segment.
- Use the following segment condition:
Page title contains Page not found
. Use the page title fragment from step 1. - Apply your segment to reports.
- Navigate to Reports > Pages.
- In Pages, you’ll find all the URLs of pages that returned a 404 error.
- In Entry pages, you’ll see the URLs of pages that showed a 404 error right at the beginning of the session. Here, you can find broken links from Google, links used wrongly on other sites and mistyped page URLs in the browser.
- Done!
After discovering page URLs that go nowhere, be sure to create redirects to pages that actually exist on your website. It’s a good move to send them to pages with similar content to what was there before. This way, you give visitors a smoother experience and keep those who might have otherwise stumbled upon dead links.
Analytics + custom reports
Another approach is to create custom reports that filter out 404 pages and help you detect broken links on your site.
To find 404 pages on your website, follow these steps:
- Find the page title of your 404 page and look for the part that remains unchanged. Example:
Page not found
or404 not found
. - Go to Menu > Analytics.
- Navigate to Custom reports.
- Select the following report type: Table.
- Set the following conditions:
- Nested dimensions:
Page URL
andPrevious page view URL
- Metric:
Page views
- Filter dimensions:
Page title contains Page not found
andEntry page title doesn't contain Page not found
. Use the page title fragment from step 1.
Note: The previous page view URL is a page that may still have a broken link. We’re skipping the first-session page URLs on purpose. We’ll make a separate report for them.
- Nested dimensions:
- Click Save.
- All done! This report lists the page URLs that caused a 404 error during the session. Click on the page URL to see the previous event URL linked to a page, probably with a broken link.
To find 404 pages that are linked from outside your site, follow these steps:
- Find the page title of your 404 page and look for the part that remains unchanged. Example:
Page not found
or404 not found
. - Go to Menu > Analytics.
- Navigate to Custom reports.
- Select the following report type: Table.
- Set the following conditions:
- Nested dimensions:
Session entry URL
,Source
andReferrer URL
. - Metric:
Page views
- Filter dimensions:
Session entry title contains Page not found
. Use the page title fragment from step 1.
- Nested dimensions:
- Click Save.
- Done! This report includes all the page URLs that returned a 404 error right at the start of the session. Here, you can find broken links from Google, misused links on referral sites and mistyped page URLs in the browser.
Click the session entry URL once to see the source. Click it again to see the referrer URL. This extra info can help you identify referral sites with broken links.