OuterciteOutercite
How-To Guides

Install Trace

Put the Trace tag on your site so arrivals from AI answers can be counted, and add the edge worker if you want AI crawler fetches too.

Trace needs something on your site. There are two ways to do it and they answer different questions: the tag sees people, the edge worker also sees crawlers.

What you'll learn

  • The difference between the tag and the worker, and which you need
  • How to install each
  • How to tell whether it is working

Which one do you need?

The tagThe Cloudflare worker
Sees human arrivalsYesYes
Sees AI crawler fetchesNoYes
Needs JavaScript to runYesNo
Where it goesYour site's headYour Cloudflare zone

The tag is enough for "who arrived from an AI answer". The worker is what you add when you also want to know which AI crawlers are fetching your pages, because a crawler does not run JavaScript and the tag never sees it.

A crawler that stops coming is an early warning that a future citation is not coming either, which is the reason the worker exists.

Install the tag

  1. Open Trace settings.
  2. Create a key for the workspace, if there is not one already.
  3. Copy the snippet and paste it into your site's head, on every page.
  4. Confirm your origins are listed, so the beacon is accepted from your domain and not from anywhere else.

There are platform-specific notes on the install page for WordPress, Shopify, Webflow, Squarespace, Wix and Google Tag Manager. If you use a tag manager, put it there rather than in the theme, so it survives a theme update.

A key belongs to a workspace. If you run several brands or several clients, use each workspace's own key, or the visits land against the wrong business.

Install the worker

The worker is a small script that runs at Cloudflare's edge, sees every request to your domain, classifies the user agent, and reports AI crawler fetches. The install is two files and two commands:

  1. Download the worker code from the worker page. You get the worker script and a wrangler.toml with your zone already filled in.
  2. Install and sign in to Wrangler, Cloudflare's CLI.
  3. Put your key in as a Cloudflare secret rather than pasting it into the code.
  4. Deploy.

The key goes in as a secret deliberately. Cloudflare encrypts secrets at rest and never shows them again in the dashboard, so a worker repo in version control never contains a usable production key.

Check it is working

  1. Visit your own site and confirm a visit appears in Trace.
  2. Look at the split between human and crawler visits. If crawler visits are zero and you deployed the worker, the worker is not seeing traffic.
  3. Compare arrivals with bound visits. Bound means the visit was joined to a citation the platform counted, and the gap between the two is normal at first.

A note on what a visit proves

An arrival is reported. A bound visit is provable. A visit with no AI source recorded is ordinary web traffic, not an AI referral, and is counted as unattributed rather than guessed at. See Trace.

Try this in Outercite

Install the tag, wait a day, then open Trace and read the "which assistants sent them" card. The mix is usually not the one people expect.

Was this helpful?

Last updated on