Where Setup Lives
AI Traffic setup now lives inside Project Settings > AI Traffic. To generate the snippet:- Open your project
- Go to Project Settings
- Open the AI Traffic tab
- Click Generate Tracking Snippet
Install the Snippet
Copy the snippet and add it to your website’s layout or template file so it loads on every page. The snippet should be placed before the closing</body> tag.
GitBook
If your documentation is hosted on GitBook, you can use the official DevTune integration instead of manually installing the snippet:- Go to your GitBook space settings
- Navigate to Integrations
- Find and install the DevTune integration from the marketplace
- Enter your project snippet key when prompted
Next.js
Add the snippet to your root layout file (app/layout.tsx or pages/_document.tsx):
WordPress
Add the snippet to your theme’sfooter.php file, or use a plugin such as “Insert Headers and Footers” to add it to the footer section.
Webflow / Squarespace
Go to Site Settings, then Custom Code, and paste the snippet in the Footer section.Plain HTML
Add a<script> tag before the closing </body> tag in your HTML template:
Enable or Disable Tracking
On the Project Settings AI Traffic tab, use the toggle switch to enable or disable tracking at any time. When disabled, incoming events are rejected and no new data is recorded.Rate Limits
Each tracking snippet is rate-limited to 1,000 requests per minute. This is enough for most sites. If your site exceeds this limit, excess requests are silently dropped.Proxy Setup
You can proxy the tracking endpoint through your own domain when you need first-party routing for your deployment setup. Teams should still honor consent requirements and local privacy rules before collecting traffic data.How It Works
Instead of the snippet sending data tohttps://devtune.ai/api/v1/llm-traffic/collect, you configure a reverse proxy, so requests go to a path on your own domain.
Vercel / Next.js
Add a rewrite tonext.config.ts:
Netlify
Add tonetlify.toml:
Cloudflare
Create a redirect rule or Worker that proxies/dt/* to https://devtune.ai/api/v1/llm-traffic/*.
nginx
Multi-Site Tracking
You can use the same tracking snippet across multiple websites or subdomains. The dashboard automatically detects distinct domains and provides a domain filter so you can view traffic for each site individually or in aggregate.Verifying Installation
After installing the snippet:- Visit your website in a browser
- Open the DevTune AI Traffic dashboard
- You should see traffic appearing within a few minutes
- The snippet is present in your page source
- The snippet key matches the one shown in Project Settings
- Ad blockers are not blocking the request
- Tracking is enabled on the AI Traffic tab
Next Steps
- AI Traffic Dashboard - Explore your traffic data
- AI Traffic Overview - Learn what gets tracked and why