tag into your index.html section.","step":[{"@type":"HowToStep","position":1,"name":"Embed script in index.html","text":"Add the script tag inside the element of your index.html file. Example:\n\n\n \n \n My React App\n \n \n \n
\n \n \n"}]}
FRAMEWORK INTEGRATION GUIDE

How to Install Analytics on React & Vite

Track single-page React apps built with Vite, Create React App, or custom Webpack setups with zero configuration.

Quick Setup: React & Vite
By Sufyaan Studio ResearchVerified August 2026

To install Analytics in a React or Vite single-page application, paste the <script defer src="https://analytics.sufyaanstudio.com/t.js" data-web="YOUR_WEBSITE_ID"></script> tag into your index.html <head> section.

KEY TAKEAWAYS
  • 1.15 KB featherlight tracker preserves React & Vite speed
  • Zero cookie consent banners required
  • Automatic SPA client route change detection
  • Full support for custom conversion event tracking
PREREQUISITES
  • React 18+ or Vite project
  • Website UUID
STEP-BY-STEP IMPLEMENTATION

Installation Instructions

1

Embed script in index.html

Add the script tag inside the <head> element of your index.html file.

REACT & VITE SNIPPET (STEP 1)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>My React App</title> <script defer src="https://analytics.sufyaanstudio.com/t.js" data-web="YOUR_WEBSITE_ID" ></script> </head> <body> <div id="root"></div> <script type="module" src="/src/main.tsx"></script> </body> </html>
FAQ & VERIFICATION

FAQ: React & Vite Analytics Integration

Ready to track React & Vite traffic with speed?

Create your account in 30 seconds and start tracking for $0.

analytics