Validate the current URL first
Complete the installation checklist in staging or production before changing the URL. Confirm:- one browser-script request and one matching script element;
- one automatic
PageViewfor the initial document; - one explicit
PageViewfor each later client-side route; - no Bily load error in the browser console; and
- no private token or credential in browser configuration.
Activate the customer subdomain
Follow the first-party tracking instructions shown for your Bily store. Add the DNS record exactly as provided. Do not invent the record name, target, or routing settings. Wait until Bily reports that the subdomain is active. Validation can take time while DNS changes become available.A custom tracking subdomain changes where the browser loads Bily. It does not remove your responsibility to honor consent, data minimization, or your privacy notice.
Prepare your content security policy
Update production policy allowlists before the URL switch:- Allow the validated tracking subdomain in
script-src. - Allow the event destinations required by your Bily installation in
connect-src. - Keep the existing destinations until rollback is no longer needed.
Copy the new complete URL
Open Bily > Settings > Apps > More settings > Install tracking after validation succeeds. Copy the new tracking URL exactly as Bily displays it. Treat it as a complete replacement:- Replace the old value in the one configuration source that owns Bily.
- Keep the new path, query string, parameter order, and encoded characters unchanged.
- Do not construct it from the customer subdomain.
- Do not keep the old URL in a second script tag or a second
init()call.
Redeploy the right configuration
Some frameworks include public environment values in the browser bundle. Rebuild and redeploy whenever you change one of those values.| Configuration | What to do after replacement |
|---|---|
Next.js NEXT_PUBLIC_ | Rebuild and redeploy |
Vite VITE_ | Rebuild and redeploy |
SvelteKit $env/static/public | Rebuild and redeploy |
Astro PUBLIC_ | Rebuild and redeploy |
| Angular compiled environment | Rebuild and redeploy |
| Nuxt public runtime configuration | Update the deployment value, then restart or redeploy as your host requires |
| A server-rendered runtime value | Restart or redeploy the process that serves the value |
.env file does not update an existing production build.
Verify the new URL
After deployment, open a new document with a full reload. Fast Refresh, hot module replacement, or a component remount cannot replace an active Bily URL because the SDK ignores a different URL after loading begins. Then:- Open a page in a fresh browser tab.
- Confirm the browser requests the new complete URL once.
- Confirm the page contains one Bily script element and no old URL.
- Confirm one automatic initial
PageView. - Navigate through client-side routes and confirm one event for each committed URL.
- Trigger one safe test action and confirm its event once.
The pre-load event queue lives in memory and does not cross the required reload. Test the new document from a known state. The Bily browser tracking ID remains stable when the site’s browser storage is still available.
Roll back as one change
If the new URL fails, restore the previous complete URL in the same configuration source. Rebuild or restart through the same deployment path, then repeat the verification checklist. Do not work around a failed subdomain by loading both URLs. Two installations can duplicate the initial page and split events between configurations.Choose your framework
Find the exact file and route lifecycle for your application.
Troubleshoot loading
Diagnose timeouts, stale builds, incorrect URLs, and duplicate installations.