Learn how to install and configure the CleverSearch tracker script on your website to enable AI-powered content optimization and analytics.
Dynamically injects optimized titles, meta descriptions, keywords, FAQs, and content paragraphs
Automatically detects and handles single-page application route changes (Next.js, React, Vue, Angular)
Tracks Core Web Vitals (LCP, FID, CLS) and page performance metrics
Collects user behavior data, page views, and interaction events
Robust error handling with automatic retries and graceful degradation
Built-in debugging capabilities for troubleshooting integration issues
<Script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
strategy="beforeInteractive"
async
data-config='{"SITE_ID": "your-site-id"}'
/><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script><script
src="https://backend.cleversearch.ai/tracker/v1/tracker.js"
async
defer
data-config='{"SITE_ID": "your-site-id"}'
></script>data-config='{"SITE_ID": "your-site-id"}'Replace "your-site-id" with your actual site ID from the dashboard.
data-config='{
"SITE_ID": "your-site-id",
"API_BASE": "https://backend.cleversearch.ai",
"DEBUG_MODE": false,
"RETRY_ATTEMPTS": 3,
"TIMEOUT": 2000
}'Most users only need the SITE_ID. Other options are for advanced use cases.
Check that the script URL is accessible and your SITE_ID is correct
Verify your site ID and check browser console for errors
Ensure the script loads before your SPA framework initializes
The script is optimized for minimal impact, but check network tab for any issues
Enable debug mode to see detailed logging in the browser console. This helps troubleshoot integration issues and verify the script is working correctly.
Method 1: URL Parameter
?clever-search-debug=trueMethod 2: Configuration
data-config='{"SITE_ID": "your-site-id", "DEBUG_MODE": true}'The script exposes a global API for manual control:
window.LLMOptimizer.refresh() // Refresh contentwindow.LLMOptimizer.getStats() // Get statisticswindow.LLMOptimizer.enableDebug() // Enable debug modeAfter installing the tracker script, you can start optimizing your content and tracking performance.