src/middleware.ts.
1
Get your token
Open Traffic in the GEO sidebar. Until the first event arrives, the page shows No activity yet with the full install panel: Install the package, Set your token and Add the proxy, and the Set your token section shows the token. The panel also has a Copy agent prompt button that copies an instruction block you can paste into a coding agent.Install the same project token on every domain the project tracks, and add extra hostnames under Tracked domains in GEO settings.
2
Install the package
3
Set the environment variable
Add the token as
NOTRA_GEO_TOKEN in your site’s environment variables, locally and at your hosting provider, and never hardcode or commit it.4
Add the tracker
src/middleware.ts
src/middleware.ts already exists, compose with sequence from astro:middleware. Astro must serve pages from a server adapter (output: "server" or hybrid) so requests exist at runtime.5
Deploy and verify
Deploy your site, and the Traffic page switches from the install panel to the dashboard as soon as Notra stores the first AI crawler or referral. Crawlers visit on their own schedule, so the first event can take a while on a quiet site.
Next steps
Tracker reference
Options, excluded paths, privacy and token rotation.
Journey tagging
Follow one agent across the pages it reads.