---
title: 404 Pages as Lead Magnets
url: https://varstatt.com/jurij/p/404-pages-as-lead-magnets
author: Jurij Tokarski
date: 2026-05-20
description: Fake Next.js crash overlay morphs into a chat. The broken URL becomes the first message. Every conversation pings my inbox.
section: Blog (https://varstatt.com/jurij/archive)
tags: ai (https://varstatt.com/jurij/c/ai), solo-business (https://varstatt.com/jurij/c/solo-business)
---

The 404 page is the one page on a site that only appears when something went wrong. The default response — "page not found, go home" — confirms the failure and the user bounces.

Tom Orbach [made the case](https://www.marketingideas.com/p/how-to-get-leads-from-your-404-page) that 404 pages should be lead magnets — especially now that AI hallucinations are sending real traffic to URLs that never existed. His version: a branded gift in exchange for an email. I wanted mine to do something different.

## The Fake Crash

Hit a broken URL on varstatt.com and you see a pixel-perfect replica of the Next.js dev error overlay. Red bar, stack trace, source preview. For about half a second, you think the site is broken.

Then the bar turns amber. A braille spinner appears. The text changes to "Handling the issue..." After a beat, the bar turns green, the message reads "Handled", and the whole thing morphs into a chat.

Under three seconds. Fast enough that you don't leave, slow enough to notice what happened. The "Handling" state has a minimum dwell of 500ms even if the AI responds in 80ms — without it, the morph feels fake.

## The URL Is the First Message

The chat doesn't ask "how can I help?" It reads the URL path as the question:

- `/pricing` → talks about the retainer
- `/json` → links to the [JSON formatter](https://varstatt.com/toolkit/json)
- `/hire` → explains how to engage
- `/joke-of-the-day` → tells you a joke

The system prompt names the requested path and instructs the model to treat it "as if it's a question."

Gibberish paths get "what were you looking for?" Anything with semantic meaning gets a real answer.

## The Content Index Is Live

The chat knows every page on the site — pricing, portfolio, 45+ developer tools, blog posts. The index is built at request time from the same sources the sitemap uses. Add a new page, the 404 chat knows about it on the next request. No rebuild.

The AI is also forbidden from inventing URLs. Linking to a page requires calling a `search_pages` tool first, and only returned paths can be used. The page that exists *because* of broken URLs doesn't get to invent its own.

## Every Question Is a Software Project

Off-topic questions — how to bake bread, how to find love, travel advice — don't get refused. They get answered through the lens of a software project.

> Bread is a build pipeline. Love is shipping without user research. Travel is a migration with no rollback strategy.

Delivered straight-faced. Short, dry, designed to be screenshotted. And it's a literal instruction in the system prompt, not an emergent quirk.

## Email Capture Without the Popup

Every conversation with three or more messages pings my inbox — full transcript, requested path, any email shared. The lead capture is decoupled from the email field.

The chat does ask for an email after a few messages, but only once. Ignore it and the conversation continues. If someone asks a Varstatt question the index can't answer, the AI says "I don't have that, drop your email and I'll get back to you." The knowledge gap becomes the capture moment.

## The Prompt Does Most of the Work

The interesting part isn't the model — it's the instructions. A few lines from the system prompt that shape the whole personality:

> "Think in short statements, not paragraphs. 'I don't know' is a complete sentence — no hedging, no disclaimers. Be opinionated by default."

> "Give one sharp observation per answer, like a senior dev giving a code review on someone's life choices."

> "Write like you're firing off a quick DM, not writing documentation. 1-3 sentences max. No bullet points. No headers. No emojis."

That last block is why the chat never falls into the LLM default of structured, hedged, three-paragraph answers. The model wants to write like documentation. The prompt tells it not to.

## Why Bother

The traffic was already hitting that URL. Now it does something.

> Break it yourself: [varstatt.com/how-to-bake-bread](https://varstatt.com/how-to-bake-bread).
