Skip to main content

Let Bily record navigation

The browser script records the initial page and supported client-side navigation automatically. Do not add manual PageView calls for those navigations; use track() for business events. This works whether you use the exact raw browser script or initialize it through @bilyai/js. Traditional multi-page sites record an initial page view on each full document load. Single-page applications use the browser runtime’s supported navigation tracking. Verify custom router behavior in staging; not every application state change is a navigation.
Do not call track("PageView") on initial mount or from router navigation hooks alongside automatic tracking. Remove older manual route listeners when upgrading.

Keep one installation

Mount one SDK initialization for the website surface. Do not add a second unmanaged browser-script tag. For Astro client transitions, preserve the reserved script as described in the framework guide.

React Router

Initialize once from a browser effect.

Next.js

Initialize from one client component in each route tree.

Confirm every page appears once

  • Direct loads and reloads produce one automatic initial PageView.
  • Supported client-side URL changes produce one automatic page view.
  • Browser Back and Forward record the resulting page once.
  • Rerenders at the same URL do not produce another event.
  • Custom business events remain separate from navigation.
If navigation is missing, inspect the loaded runtime and the browser network requests before adding another page-view sender. ready() confirms runtime initialization, not destination delivery.

Verify page views

Test direct loads, reloads, route transitions, and browser history.