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.
Edit index.html
Add the script to the HTML template that React renders inside.
Prerequisites
- •A React project with CRA or Vite
public/index.html file (CRA) or index.html in project root (Vite)CRA puts it in public/. Vite puts it at the project root.
<head> sectionThis contains meta tags, title, and links to stylesheets.
Add it near the top of <head> for earliest loading.
<script async src="https://analytics.tradly.dev/tracker.js" data-server="https://analytics.tradly.dev" data-project="marketplace"></script>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