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.
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. Retrieve Client ID in Settings > Integrations
Navigate to Settings > Tracking JS and copy your unique asynchronous tracking snippet.
2. Embed Script in Root <head> Tag
Paste the snippet before the closing </head> tag of your global template.
3. Verify Real-Time Telemetry Stream
Open an incognito window, browse your site, and confirm instant event recording in Dashboard > Live Traffic.
4. Connect Payment Gateway Webhooks
Configure Stripe or Shopify webhooks to automatically match paying customers with their initial AI referral touchpoint.
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
<!-- 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 ArticlesAEO Technical Auditor: Complete 256-Token Vector Chunking & Entity Density Manual
The step-by-step guide to analyzing 256-token RAG chunking, entity density, and fixing the 10 AI extraction dimensions.
Smart Remediation: Automated Code, Syntax & Entity Rewriting Engine
Transform failing technical audits into production-grade HTML tags, declarative micro-answers, and validated JSON-LD scripts.
Citation Sniper: Reverse-Engineer Competitor AI Citations & Win #1 Spot
Monitor commercial prompts on ChatGPT, Claude, and Perplexity to identify when competitors are cited and deploy surgical counter-articles.