No hits are appearing in Agent Analytics
No hits are appearing in Agent Analytics
Confirm the middleware is deployed
middleware isn’t listed after a deploy, your middleware.ts file may not be at the root of your Next.js project, or the deployment that included it hasn’t finished. Re-deploy and check again.Confirm AEN_EDGE_TOKEN is set in Vercel
.env file. Go to Vercel → your project → Settings → Environment Variables and confirm AEN_EDGE_TOKEN is present and non-empty. The middleware reads it as process.env.AEN_EDGE_TOKEN; if it’s blank, the middleware calls NextResponse.next() on the first line and returns before any detection runs.Trigger a real answer-engine crawler
ChatGPT-User, OAI-SearchBot, PerplexityBot, Claude-SearchBot) sends a request the middleware can match.Note which crawlers are not recorded
Verification level does not gate recording
UA_ONLY; a request from a published vendor IP is recorded as IP_VERIFIED. Both show up in the By verification level breakdown. Verification only decides whether the optimized variant is served — not whether the hit is counted./api/v1/edge/telemetry — it never blocks your page response. If network conditions caused that call to fail silently, the hit won’t appear. Re-testing with a fresh crawler request is the fastest way to confirm.A page isn't being served the optimized version
A page isn't being served the optimized version
Confirm SERVE_MODE is set to default
middleware.ts ships with SERVE_MODE set to "shadow" by design — a safe rollout mode that records what it would serve but always delivers your normal page. To actually serve the optimized variant, change the constant and re-deploy:"shadow", no variant is ever served, regardless of verification level.Confirm the bot was IP_VERIFIED
IP_VERIFIED. A UA_ONLY request — user-agent matched but source IP not in a published range — always receives your normal page, even in "default" mode. Check the By verification level breakdown in Agent Analytics.Verify the bot's purpose class
USER_TRIGGERED or RETRIEVAL (the middleware’s enabled set). Bots with other purposes — for example training crawlers like GPTBot or ClaudeBot — pass through to your normal page. Check the By agent purpose breakdown for the hit in question.Check whether a fresh artifact exists for the URL
fresh. The middleware requests /api/v1/edge/artifact per hit; if the control plane has no fresh artifact it returns a 404 and the middleware falls through to your normal page. Find the URL in the Optimized pages list in Agent Analytics and check its status. If it’s missing or not fresh, use Regenerate to build one.Middleware isn't running — everything passes through
Middleware isn't running — everything passes through
Verify the file name and location
middleware.ts (or middleware.js) and placed at the root of your project — the same directory as package.json. Placing it inside src/, app/, pages/, or any other subdirectory makes Next.js ignore it silently.Confirm you're deployed on Vercel Edge
next/server and runs on the Vercel Edge runtime. If you’ve customised your project’s runtime settings or are self-hosting outside Vercel, confirm the middleware appears under the project’s Functions tab after deploying.Check that AEN_EDGE_TOKEN is non-empty
process.env.AEN_EDGE_TOKEN is empty or undefined, the middleware calls NextResponse.next() and returns immediately — no detection, no telemetry, no serving. Confirm the variable is set in Vercel and that you redeployed after adding it.Worried about SEO or search ranking impact
Worried about SEO or search ranking impact
Understand the cloaking firewall
isSearchIndex set. If it does, it calls NextResponse.next() and returns your normal page — no variant, no branching, and no telemetry. Googlebot, Bingbot, and Applebot always receive your normal page, without exception.Understand why this matters for AI Overviews
Understand content parity
OAI-SearchBot, Claude-SearchBot, PerplexityBot, and ChatGPT-User), the served variant carries the same substance as your page — restructured into answer-first markdown that machines parse more reliably. (The offline generator also produces schema.org JSON-LD as part of the stored artifact, though this drop-in serves the markdown form.) The generator restructures your existing page under a strict-parity grounding guardrail: it never publishes anything your source page didn’t already say.Optimized artifact looks out of date after editing a page
Optimized artifact looks out of date after editing a page
Use the Regenerate action
How stale artifacts behave
fresh — a non-fresh artifact returns a 404 and the middleware serves your normal page rather than stale content. The out-of-date case to watch for is an artifact still marked fresh that was generated before your edit: it keeps serving the older content until you Regenerate.No edge redeploy needed