Tracking Pixel Installation

Add a lightweight JavaScript snippet to your website to start tracking AI bot visits.

Lightweight inline script
No cookies
Catches fast bots

Basic Installation

Add the following script tag to your HTML, just before the closing </body> tag:

HTMLRecommended
<!-- AI Search Index - Tracking Pixel -->
<script>
(function(){
  var img = new Image(1,1);
  var params = "tid=YOUR_TRACKING_ID&url=" + encodeURIComponent(window.location.href);
  if (document.referrer) params += "&ref=" + encodeURIComponent(document.referrer);
  img.src = "https://api.aisearchindex.com/api/pixel?" + params;
  img.style.cssText = "position:absolute;left:-9999px;visibility:hidden";
  img.alt = "";
  document.body.appendChild(img);
})();
</script>
<noscript><img src="https://api.aisearchindex.com/api/pixel?tid=YOUR_TRACKING_ID" width="1" height="1" style="position:absolute;left:-9999px;visibility:hidden" alt="" /></noscript>

Note: Replace YOUR_TRACKING_ID with your actual tracking ID from the dashboard.

How It Works

The tracking pixel is a lightweight inline script that creates an invisible 1x1 image. This image request sends your tracking ID, page URL, and referrer to our tracking endpoint.

  • No external dependencies — the script runs inline for immediate execution
  • Catches fast bots — inline scripts execute immediately, before AI crawlers leave the page
  • No cookies — privacy-friendly tracking without storing anything on the user's device
  • Noscript fallback — the image tag works even when JavaScript is disabled

Framework Guides

Detailed installation instructions for popular frameworks:

Verify Installation

After adding the script, verify it's working correctly:

  1. Open your website in a browser
  2. Open Developer Tools (F12 or right-click → Inspect)
  3. Go to the Network tab
  4. Look for a request to https://api.aisearchindex.com/api/pixel
  5. Visit your dashboard to see incoming data

Tip: The request will appear as an image (1x1 pixel) in the Network tab. Filter by "Img" to find it quickly.