How to Install the Tracking Script
Platform-specific installation guides for LLMDiscovery.ai
One Script, All Platforms
The LLMDiscovery.ai tracking script works on any website. Just add one line of code to your <head> section.
<script async src="https://llmdiscovery.ai/track.js" data-site-id="YOUR_SITE_ID"></script>
WordPress
Install using a plugin or theme editor
Method 1: Using a Plugin (Recommended)
- 1
Install "Insert Headers and Footers" plugin
Go to Plugins → Add New → Search for "Insert Headers and Footers" → Install & Activate
- 2
Navigate to Settings → Insert Headers and Footers
- 3
Paste your tracking script in "Scripts in Header"
<script async src="https://llmdiscovery.ai/track.js" data-site-id="YOUR_SITE_ID"></script>
- 4
Click "Save"
The script will now load on every page of your site
Method 2: Theme Editor (Advanced)
Warning
Editing theme files directly can break your site if done incorrectly. Create a child theme or use Method 1 instead.
- 1. Go to Appearance → Theme File Editor
- 2. Select
header.phpfrom the right sidebar - 3. Find the
</head>tag - 4. Paste your tracking script just before
</head> - 5. Click "Update File"
Shopify
Add to your theme's liquid file
- 1
Go to Online Store → Themes
- 2
Click "Actions" → "Edit code"
- 3
Open
theme.liquidLocated in the "Layout" folder
- 4
Find the
</head>tagUsually around line 100-150. Use Ctrl+F to search
- 5
Paste your tracking script just before
</head><script async src="https://llmdiscovery.ai/track.js" data-site-id="YOUR_SITE_ID"></script> </head> - 6
Click "Save"
React / Next.js
Add to your document head or layout
Next.js (App Router)
Add to your root layout.tsx file:
// app/layout.tsx
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html lang="en">
<head>
<Script
src="https://llmdiscovery.ai/track.js"
data-site-id="YOUR_SITE_ID"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
)
}Next.js (Pages Router)
Add to your _document.js file:
// pages/_document.js
import { Html, Head, Main, NextScript } from 'next/document'
import Script from 'next/script'
export default function Document() {
return (
<Html>
<Head>
<Script
src="https://llmdiscovery.ai/track.js"
data-site-id="YOUR_SITE_ID"
strategy="afterInteractive"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}Create React App
Add to your public/index.html file:
<!-- public/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- ... other meta tags ... -->
<script async src="https://llmdiscovery.ai/track.js"
data-site-id="YOUR_SITE_ID"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>Static HTML
Simplest installation method
Paste the tracking script in the <head> section of your HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Website</title>
<!-- LLMDiscovery.ai Tracking Script -->
<script async src="https://llmdiscovery.ai/track.js"
data-site-id="YOUR_SITE_ID"></script>
</head>
<body>
<!-- Your content -->
</body>
</html>Verify Installation
Check if the script is working correctly
Method 1: Dashboard Badge
- Return to your LLMDiscovery.ai dashboard
- Look for your site in the list
- You should see a green "Script Installed" badge
Method 2: Browser Developer Tools
- Visit your website
- Open browser DevTools (F12 or right-click → Inspect)
- Go to the "Network" tab
- Reload the page
- Look for a request to
track.js - Status should be 200 (success)
Method 3: View Page Source
- Visit your website
- Right-click → "View Page Source"
- Search for "llmdiscovery.ai" (Ctrl+F)
- You should see the tracking script in the <head> section
Troubleshooting
Script not loading?
- Check that you replaced
YOUR_SITE_IDwith your actual site ID - Verify the script is in the <head> section, not <body>
- Clear your browser cache and reload
- Check for JavaScript errors in the console (F12 → Console tab)
Still showing "Script Not Found"?
- Wait 5-10 minutes for DNS propagation
- Ensure your website is publicly accessible (not localhost)
- Check if a CDN or caching plugin is delaying the update