afterEach() hook.
Do not add a raw Bily script tag. init() loads the exact tracking URL for this installation path.
Install Bily
Set the public tracking URL
Copy the complete URL from Bily > Settings > Apps > More settings > Install tracking..env
VITE_ values in the browser bundle. The value is public installation data, not a private token. Rebuild and redeploy when it changes.
Start after the initial route
Create one module that waits for Vue Router to finish its initial navigation. Bily then records that final initial page automatically.src/bily.ts
src/main.ts
router.isReady() lets initial redirects settle before Bily loads. afterEach() runs after a navigation is confirmed. The URL guard ignores repeated notifications and failed navigations.
Track successful actions
src/components/SavePreferenceButton.vue
Verify Vue tracking
Check the initial page, successful routes, redirects, and action events.
Replace the tracking URL
Move to the validated customer subdomain as one deployment change.