# React (https://talivia.com/docs/installation-guides/react)



For React apps, add the tracker to the HTML shell that wraps the app.




## Vite [#vite]

Open `index.html` and place the snippet before the closing `</body>` tag.

```html
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
```

## Create React App [#create-react-app]

Open `public/index.html` and place the snippet before the closing `</body>` tag.

```html
<div id="root"></div>
<script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
```

Use your Talivia website ID. The example ID is only a placeholder.

Talivia listens to browser history changes, so route changes in React Router are tracked after the script loads.
