← All platforms

    Installation Guide · React (CRA / Vite)

    How to Add Agent Analytics to Your Website

    One script captures what visitors browse. That becomes memory your analytics can understand. And agents like Jack turn it into actions — recovery emails, demand segments, conversion insights.

    Install on React (CRA / Vite)

    ⚛️

    React (CRA / Vite)

    For Create React App or Vite projects, you add the script directly to your index.html file.

    Easy·1 min·1 method

    Edit index.html

    Add the script to the HTML template that React renders inside.

    Prerequisites

    • A React project with CRA or Vite
    1
    Open the public/index.html file (CRA) or index.html in project root (Vite)

    CRA puts it in public/. Vite puts it at the project root.

    2
    Find the <head> section

    This contains meta tags, title, and links to stylesheets.

    3
    Paste the tracking script inside the tag

    Add it near the top of <head> for earliest loading.

    Paste this
    <script async src="https://analytics.tradly.dev/tracker.js" data-server="https://analytics.tradly.dev" data-project="marketplace"></script>
    4
    Save and restart your dev server

    Run npm run dev (Vite) or npm start (CRA) to see changes.

    Troubleshooting (3 common issues)
    • In Vite, the file is index.html at project root, not in public/
    • In CRA, the file is public/index.html — not src/index.html
    • For production builds, the script will be included automatically in the built HTML

    Need help? Contact support@tradly.dev or check our FAQ.

    Last updated: January 2025