Skip to main content
DocsInstallation
Quickstart · 2 minutes

Install CiteRoute Telemetry

Choose the integration method that matches your architecture. Edge Middleware captures headless AI crawlers before page render, while the Client Script tag offers instant zero-code setup for static sites and CMSs.

middleware.ts (or src/middleware.ts) · Project Root
// 1. Install official SDK:
// pnpm add @citeroute/edge

import { createNextMiddleware } from '@citeroute/edge/next';

export const middleware = createNextMiddleware({
  domain: 'yourdomain.com', // Replace with your domain
  apiKey: process.env.CITEROUTE_API_KEY, // Optional cr-live_ key
  optimizeForBots: true, // Rewrites bot responses to clean Markdown
  manifestPath: '/.well-known/agent.json',
  llmsTxtPath: '/llms.txt',
});

export const config = {
  matcher: ['/((?!api/|_next/static|_next/image|favicon.ico|robots.txt).*)'],
};

Install via `pnpm add @citeroute/edge`. Intercepts headless AI crawlers (GPTBot, ClaudeBot, etc.) before page render. Automatically serves /.well-known/agent.json and /llms.txt with zero added latency.

No cookies or PII
Zero added page latency
Serverless & Edge ready

Verify your installation

Enter your domain and we'll probe whether Edge Middleware or the Tracking Tag is active.

Verify the installation

1

Open your site + DevTools

Network tab → filter "track". You should see a POST to citeroute.com/api/v1/track fire on page load.

2

Check the response

You will see:

{ "success": true, "recorded": false, "classification": "HUMAN" }
3

Verify ownership in My Sites

Add your domain under My Sites. We give you a meta tag or DNS TXT record unique to your account. Publish either one so only you can view the site's analytics. An installed tag alone does not prove ownership.

4

All good

Human visits are not stored by design. AI crawlers appear in your analytics within 24-48 h. Run a GEO Audit to kick-start crawling.

FAQ

What is yourdomain.com?

Replace it with your actual domain - e.g. stripe.com or myblog.io. Do not include https:// or a trailing slash. This is how CiteRoute attributes AI traffic to your site.

Does it slow down my site?

No. The async attribute means it never blocks rendering. The beacon fires via navigator.sendBeacon on the load event - fire-and-forget, no response wait.

Is it GDPR / CCPA compliant?

Yes. No cookies. No IP addresses stored. No personal data collected. The only data sent is the URL path and an anonymous sessionStorage ID. Human visits are never written to the database.

I see recorded: false - is that normal?

Yes. Human visits are intentionally not stored. CiteRoute only persists AI crawler and agent traffic. recorded: false means the script is working correctly.

Do I need an API key?

No. The tag works without any account. API keys are only needed if you want to query the CiteRoute REST API directly.

What to do next