Find your installation path
| Website | Start Bily in | Observe later routes with |
|---|---|---|
| Plain HTML | Shared <head> | A new document loads the script again |
| Vanilla JavaScript | Browser entry module | Your router’s committed-navigation callback |
| React Router | One component inside the existing router | useLocation() |
| Next.js | One shared client component | usePathname() and useSearchParams() |
| Vue | Browser bootstrap after the router is ready | router.afterEach() |
| Nuxt | One client plugin | useRouter().afterEach() |
| Svelte | Browser entry module | Your router’s committed-navigation callback |
| SvelteKit | Root layout component | afterNavigate() |
| Angular | One root service | NavigationEnd |
| Astro | Shared layout script | Persisted script plus astro:page-load |
| React Router framework mode or Remix | One component in the root route | useLocation() |
Choose a guide
Plain HTML
Add the exact browser script to every document through one shared layout.
Vanilla JavaScript
Initialize from a browser entry module and connect your router callback.
React Router
Mount one tracking component inside the router you already use.
Next.js
Cover App Router, Pages Router, or both with one shared component.
Vue
Wait for the initial route, then observe successful navigations.
Nuxt
Start Bily from one client plugin after the first page finishes.
Svelte and SvelteKit
Use the browser entry for Svelte or the root layout for SvelteKit.
Angular
Subscribe once to successful Angular Router navigation.
Astro
Support full document loads and optional client-side transitions.
React Router framework mode and Remix
Add one component to the root route without replacing its document shell.
Keep one contract everywhere
Every framework follows the same rules:- Copy the complete tracking URL from Bily > Settings > Apps > More settings > Install tracking.
- Let
@bilyai/jsown the loader unless a framework guide reserves one script element for the SDK to reuse. Never add a second unmanaged tag. - Let the browser script record the initial
PageView. - Send one explicit
PageViewafter each later committed client-side route. - Ignore repeated notifications when
window.location.hrefhas not changed.
Verify the installation
Prove the script, initial page, later routes, and action events appear once.
Move to first-party tracking
Replace the complete tracking URL after Bily validates your customer subdomain.