Analytics & Attribution

Stealth Tracking JS: 1.8 KB Cookieless Telemetry & AI Referral Attribution

Capture and attribute visitors arriving from ChatGPT, Claude, Perplexity, and SearchGPT without third-party cookies or performance penalties.

Standard analytics tools like Google Analytics misclassify up to 80% of generative AI search traffic as 'Direct / None'. AnswerShaper's Stealth Tracking JS is an ultra-fast 1.8 KB asynchronous script that decodes native mobile app referrers, custom user-agent parameters, and AI query parameters to calculate precise customer acquisition costs.

AEO Direct AnswerDirect Answer / AI Executive Summary

Stealth Tracking JS is a zero-dependency, cookieless client script (1.8 KB) that decodes custom HTTP client tokens and AI referrer schemes with zero layout shift (CLS 0.00). It streams events directly to your dashboard and binds checkout webhooks to compute exact AI Customer Acquisition Cost (CAC).

Step-by-Step Walkthrough & User Guide

1

1. Retrieve Client ID in Settings > Integrations

Navigate to Settings > Tracking JS and copy your unique asynchronous tracking snippet.

2

2. Embed Script in Root <head> Tag

Paste the snippet before the closing </head> tag of your global template.

3

3. Verify Real-Time Telemetry Stream

Open an incognito window, browse your site, and confirm instant event recording in Dashboard > Live Traffic.

4

4. Connect Payment Gateway Webhooks

Configure Stripe or Shopify webhooks to automatically match paying customers with their initial AI referral touchpoint.

5

5. Inspect CAC & Financial ROI Reports

Review executive analytics comparing AEO customer acquisition costs against traditional Google Ads campaigns.

Pro Tips & Engineering Best Practices

  • 100% GDPR and CCPA compliant: does not store client cookies or collect personal identifiers.
  • For Next.js App Router, implement using next/script with strategy='afterInteractive'.
  • Enable webhook alerts for high-value enterprise AI referral visits.

Code & Technical Integration

Production Stealth Tracking JS Tag

Production Stealth Tracking JS Taghtml
<!-- AnswerShaper Stealth Tracking JS (1.8 KB) --> <script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'as.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://cdn.answershaper.com/as-track.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','asLayer','AS-LIVE-KEY-12345'); </script>

Related Documentation & Guides

All Articles