Skip to main content

What this lets you do

Paste one line into your HTML and start detecting AI-referred traffic on every page that includes it.

Before you start

  • Your Traceten site key, from Sites → Install in the dashboard. It looks like ttid_7Rb4TrC1dTbnD8w3s1TS12: always ttid_ followed by 22 letters and digits, and case-sensitive.
  • Write access to the HTML file or template that contains your site’s <head> tag.

Steps

1

Open your HTML template

Find the file containing your global <head> tag. For a simple static site, this is usually index.html. For a templating system (Jinja, Handlebars, ERB), it’s whatever file wraps every page, typically named base.html, layout.html, or _layout.html.If each page has its own <head>, you’ll need to add the snippet to each file. Using a shared layout template is simpler.
2

Paste the snippet before </head>

Add the tag anywhere inside your <head> block. Copy it from Sites → Install for your site so data-site (your site key) is already yours. data-cookie-domain only appears once you’ve confirmed a value under Sites → Settings → Cookies. It’s off by default, so a freshly created site’s tag won’t carry it yet.
The async attribute is important. It tells the browser to load the script without waiting for it, so the snippet never delays your page from rendering.data-cookie-domain keeps one visitor as one visitor across your subdomains, so an AI referral that lands on example.com still gets credit for a signup that completes on app.example.com. It’s off by default, so confirm a value under Sites → Settings → Cookies first if you want it. Leave it as the dashboard gives it to you once you have. If your site has no subdomains it does no harm, and if the value does not match the page it is ignored. See Subdomains and cross-domain.
3

Deploy your changes

Push or upload the updated file to your hosting provider.
4

Verify it works

Open your site in a browser, then open Sites → Install in the dashboard and look at the Verify step. It should turn green within 30 seconds of a pageview.

Notes

The snippet does not block rendering. The async attribute and internal use of requestIdleCallback mean the snippet has no impact on your Largest Contentful Paint or Time to Interactive scores. The snippet is under 10KB gzipped. It has zero runtime dependencies and no external requests other than the single event POST to ingest.traceten.com. One site key per domain. If you run multiple sites (e.g. example.com and docs.example.com), create a separate site in the dashboard for each and use their respective keys.

Next steps