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 tag | The Cloudflare worker | |
|---|---|---|
| Sees human arrivals | Yes | Yes |
| Sees AI crawler fetches | No | Yes |
| Needs JavaScript to run | Yes | No |
| Where it goes | Your site's head | Your 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
- Open Trace settings.
- Create a key for the workspace, if there is not one already.
- Copy the snippet and paste it into your site's head, on every page.
- 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:
- Download the worker code from the worker page. You get the worker script and a
wrangler.tomlwith your zone already filled in. - Install and sign in to Wrangler, Cloudflare's CLI.
- Put your key in as a Cloudflare secret rather than pasting it into the code.
- 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
- Visit your own site and confirm a visit appears in Trace.
- 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.
- 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.
Related
Trace
What the lens shows and how to read it.
Readiness
Which crawlers you should be allowing in the first place.
Data handling and privacy
What the tag collects.
Last updated on
