init() loads the script for you.
Install Bily
Set one public build value
For a Vite build, copy the complete tracking URL into a public environment value..env
Create the tracking component
Choose the import that matches the framework. Both versions follow the same route contract.- React Router framework mode
- Remix
app/bily-tracking.tsx
init() calls with the same URL are safe, and the URL guard keeps development checks from duplicating route events.
Mount it in the existing root route
Add<BilyTracking /> inside the default root component, where useLocation() already has router context.
- React Router framework mode
- Remix
app/root.tsx
Track successful actions
Calltrack() from browser code after the operation succeeds.
app/routes/settings.tsx
Verify framework routes
Check direct loads, nested routes, search changes, redirects, and browser history.
Move to first-party tracking
Replace the bundled URL after Bily validates the customer subdomain.