Install Bily
Expose one public runtime value
Copy the complete tracking URL from Bily > Settings > Apps > More settings > Install tracking..env
nuxt.config.ts
runtimeConfig.public.
Add one client plugin
In Nuxt 4, createapp/plugins/bily.client.ts. In a Nuxt 3 project without the app/ directory structure, create plugins/bily.client.ts.
app/plugins/bily.client.ts
.client suffix keeps startup in the browser. The browser script records the initial page automatically.
useRouter().afterEach() runs after Nuxt’s router commits a navigation. Waiting for Vue’s next update captures the new page title as well as the new URL. The hook also observes query-only changes when Nuxt reuses the current page component. Comparing the complete URL prevents repeated lifecycle notifications from creating duplicates.
Track successful actions
Calltrack() from a component or composable after the named operation completes.
app/components/CompleteCheckoutButton.vue
Change the URL safely
When Bily validates a customer subdomain, replaceNUXT_PUBLIC_BILY_SCRIPT_URL with the new complete value. Update the deployment environment, then restart or redeploy as your hosting setup requires.
Never run the old and new URLs together.
Verify Nuxt tracking
Confirm the first page, path changes, and query-only routes appear once.
Move to first-party tracking
Validate, replace, deploy, and verify the customer-subdomain URL.