Skip to Content
Install GuidesReact (Vite / CRA)

React (Vite / CRA)

React apps scaffolded with Vite or Create React App have a single index.html file that acts as the entry point for every page. That’s where the snippet goes.

Open index.html at the root of your project and paste the snippet inside the <head>:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>My App</title> <script defer src="https://api.snowanalytics.app/sa.js" data-site="YOUR_SITE_ID"></script> </head> <body> <div id="root"></div> </body> </html>

Because this file is the shell for your entire app, the snippet is automatically included on every page.

SPA route tracking

You do not need to add anything to your router. Snow hooks the browser History API, so route changes triggered by React Router, TanStack Router, or any other client-side router are tracked automatically. See Single-page apps.

Verify

Run your app locally (npm run dev) or open the deployed version in a browser, then check the Live view in the Snow dashboard. See Troubleshooting if nothing appears.