Skip to content
Broken links

Find the broken links that cost you visitors

3 min read · Updated · By the Reveata team

Every visit that lands on a "page not found" is a person who clicked a link expecting something. Some of them came from another site that linked to you, which makes them especially valuable and especially easy to lose. Broken links pile up quietly after a redesign, a renamed product or a moved blog, and most analytics setups never show them.

1. Record 404s

The 404 goal lives in the small extras script, next to the main tracking script:

html
<script defer src="https://reveata.com/js/script.extras.js" data-track-404></script>

With data-track-404, the built-in 404 goal is sent when a page is answered with HTTP status 404, in browsers that report the status.

Single-page apps often answer every route with 200 and show a "not found" view in the browser. For those, leave out the attribute and mark the view instead: a page containing <meta name="reveata:404">, or an element with data-reveata-404, sends the goal. With Next.js, render <ReveataNotFound /> in app/not-found.tsx. See Custom goals.

The goal carries the missing path and the address of the page that linked to it, both without query strings.

The dashboard's Broken links (404) card lists each missing path with its hits, visitors and the top referrer. Sort it in your head by who sent people:

  • A referrer on another website: someone links to a page that moved. Add a redirect on your side, then consider asking them to update the link.
  • A referrer on your own site: an internal link is wrong. Fix the link itself; a redirect only hides it.
  • No referrer: an old bookmark, a link in an email or app, or a mistyped address. Redirect it if the path is close to a real page.

3. Fix in order of value

Start with the paths that have the most visitors, and among those, the ones whose referrer is a site that sends buyers. To check, open the Sources card on the Referrer tab sorted by Revenue: a referrer that appears there and in the broken links card is the first fix.

4. Check after a redesign

A redesign is the most common source of broken links. Pin the week after launch as a custom range, open the card, and look for paths that only appeared after the change. If you connected GitHub, commits on the chart show which release it was.

5. Get told about new ones

The 404 goal is a goal like any other, so you can add an alert of the type A goal is completed on it. On a busy site that can be noisy; a weekly look at the card is often enough. See Alerts.

What else the extras script records

The same script can record file downloads (data-downloads), form submissions (data-forms) and web vitals (data-vitals). Turn on only what you need; each goal counts towards your plan's events. See Reduce your event usage.

What to do next

  • Add the extras script with data-track-404 and wait a week for data.
  • Redirect the top three missing paths and fix the internal links among them.
  • Add a check of the card to the week after every redesign or URL change.

Do it in Reveata

In the dashboard

  1. Add script.extras.js with data-track-404 (or the meta tag for a single-page app).
  2. Open the Dashboard and find the Broken links (404) card.
  3. Work through the paths with the most visitors first, starting with those linked from other sites.

With the API

Missing pages for the last 30 days, with hits, visitors and the top referrer:

bash
curl -G https://reveata.com/api/v1/websites/example.com/analytics/not-found \
  -H "Authorization: Bearer $REVEATA_TOKEN" \
  --data-urlencode "period=last_30d"

With an AI assistant

With the MCP server connected, ask:

Use get_not_found_pages for the last 30 days and group the missing paths into those linked from other websites, those linked from my own pages and those with no referrer, most visitors first.

Try it in your dashboardOpen your website in Reveata and follow the steps above with your own numbers.
Open dashboard →
Was this guide useful?

Next guides