Back to Documentation

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. 1

    Install "Insert Headers and Footers" plugin

    Go to Plugins → Add New → Search for "Insert Headers and Footers" → Install & Activate

  2. 2

    Navigate to Settings → Insert Headers and Footers

  3. 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. 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. 1. Go to Appearance → Theme File Editor
  2. 2. Select header.php from the right sidebar
  3. 3. Find the </head> tag
  4. 4. Paste your tracking script just before </head>
  5. 5. Click "Update File"

Shopify

Add to your theme's liquid file

  1. 1

    Go to Online Store → Themes

  2. 2

    Click "Actions" → "Edit code"

  3. 3

    Open theme.liquid

    Located in the "Layout" folder

  4. 4

    Find the </head> tag

    Usually around line 100-150. Use Ctrl+F to search

  5. 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. 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

  1. Return to your LLMDiscovery.ai dashboard
  2. Look for your site in the list
  3. You should see a green "Script Installed" badge

Method 2: Browser Developer Tools

  1. Visit your website
  2. Open browser DevTools (F12 or right-click → Inspect)
  3. Go to the "Network" tab
  4. Reload the page
  5. Look for a request to track.js
  6. Status should be 200 (success)

Method 3: View Page Source

  1. Visit your website
  2. Right-click → "View Page Source"
  3. Search for "llmdiscovery.ai" (Ctrl+F)
  4. You should see the tracking script in the <head> section

Troubleshooting

Script not loading?

  • Check that you replaced YOUR_SITE_ID with 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

Need more help?

Contact our support team:

support@llmdiscovery.ai

Related Documentation