Generate Your Tracking Snippet
- Open your project in DevTune
- In the sidebar, expand AI Traffic and select Settings
- 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.
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 like “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 AI Traffic Settings page, use the toggle switch to enable or disable tracking at any time. When disabled, the collection endpoint rejects incoming events and no data is recorded.Rate Limits
Each tracking snippet is rate-limited to 1,000 requests per minute. This is more than sufficient for most websites. If your site exceeds this limit, excess requests are silently dropped.Proxy Setup (Avoid Ad Blockers)
Some ad blockers and privacy extensions block requests to third-party tracking domains. You can proxy the tracking endpoint through your own domain so the request appears first-party and is not blocked.How It Works
Instead of the snippet sending data todevtune.ai/api/v1/llm-traffic/collect, you configure a reverse proxy so requests go to yoursite.com/dt/collect, which forwards them to DevTune.
Vercel / Next.js
Add a rewrite tonext.config.ts:
Netlify
Add tonetlify.toml:
Cloudflare
Create a redirect rule or Cloudflare Worker that proxies/dt/* to devtune.ai/api/v1/llm-traffic/*.
nginx
Update Your Snippet
After setting up the proxy, update the beacon URL in your snippet. Replacedevtune.ai/api/v1/llm-traffic/collect with your proxy path (e.g., yoursite.com/dt/collect).
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 dropdown 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 (View Source in browser)
- The snippet key matches the one shown in your AI Traffic Settings
- Ad blockers are not blocking the request (check browser DevTools Network tab, or set up a proxy)
- Tracking is enabled (the toggle on the Settings page is active)
Next Steps
- AI Traffic Dashboard - Explore your traffic data
- AI Traffic Overview - Learn what gets tracked and why