Embedding an Onboarding Checklist on a Customer's Custom Domain
What breaks when your checklist widget has to run under app.customer.com instead of your own domain, and how to design around it.
Most onboarding widgets are built, tested, and demoed on one domain: yours. The script tag sits on your own app, the cookies it sets belong to your own origin, and the API it calls shares that origin or a subdomain of it. Then a customer on a white-label or custom-domain plan points app.customer.com at your product, and the checklist that worked everywhere else starts failing quietly — a step that never marks complete, a progress bar that resets on every page load, or a widget that simply doesn't render.
None of this is exotic. It's the ordinary consequence of browsers treating origins strictly, and a widget built without custom domains in mind running into that wall for the first time when a real customer hits it.
Why the domain change breaks things that worked before
A checklist widget typically needs three things to function: it needs to load its script and styles from somewhere, it needs to persist a user's progress somewhere, and it needs to know which account the current visitor belongs to. On your own domain, all three can lean on first-party cookies and same-origin requests, and none of that needs special thought.
Move the host page to a domain you don't control, and every one of those defaults is now a cross-origin call. A cookie your API sets gets scoped to your domain, not the customer's — which is correct and expected, but means a widget relying on that cookie for session state has nothing to read on a return visit from app.customer.com. The browser isn't being unreasonable. It's doing exactly what cross-site cookie rules are supposed to do.
Identify the account explicitly, don't infer it from the host
The fix that holds up is to stop asking the hostname to tell you which account a visitor belongs to. A widget embedded on a custom domain should carry an explicit account or project identifier in its init call, the same token-based approach already needed for external identity providers: a short-lived signed token issued by your backend, passed into the embed script, rather than derived from whatever domain happened to load it.
<script src="https://cdn.example.com/checklist.js" data-account-token="eyJhbGciOi..." async></script>That token should identify the account and the current user, and it should be short-lived enough that leaking it in a page source isn't a standing risk. The widget then authenticates every API call with that token instead of a cookie, which sidesteps the cross-origin cookie problem entirely rather than trying to work around it with cookie flag tricks that browsers are actively tightening year over year.
Decide where progress actually gets stored
Once the token carries identity, the natural place for step progress to live is your own backend, reached over a CORS-enabled API call rather than a cookie-scoped one. That means every request needs an explicit Access-Control-Allow-Origin response that either allow-lists the customer's domain or validates it server-side against a list of domains registered to that account — a wildcard origin header defeats the purpose of using a token in the first place, since it would let any page present a stolen token.
This is also where custom domains intersect with a problem covered in the piece on multi-tenant onboarding: a customer running the checklist on their own domain is, from your system's point of view, just another tenant, and the account-to-domain mapping needs to be a real, auditable table rather than an assumption baked into routing.
Assets and CSP need the same rigor
If the host page runs a Content Security Policy, which a white-labeled customer's compliance team is more likely to require than your own, the widget's script, style and API origins all need to appear in that policy or the browser blocks them outright with no visible error beyond the console. This is close enough to the problem described in the piece on embedding under a strict CSP that the same checklist of required directives applies: script-src, connect-src and img-src for the cover or avatar assets the widget might load.
Testing this before a customer finds it
The honest way to catch these failures before a customer does is to run the widget's full flow — load, identify, complete a step, reload, confirm the step stayed complete — from a second domain in a test environment, not just from the one you built it on. A throwaway local DNS override that points a second hostname at your dev server is enough to reproduce the cross-origin conditions; testing only on your own domain and calling it done is how this ships broken.
What to measure
Whether this actually matters for your product depends on how many accounts run on custom domains versus your own, and that split isn't something to guess at. The number to pull, once you have account-level analytics in place, is completion rate on custom-domain accounts versus same-origin accounts for the same checklist. If custom-domain accounts complete steps at a meaningfully lower rate, that gap is the signal something in the cross-origin path is silently failing for a slice of users who never file a ticket about it — they just stop finishing onboarding and you don't find out why.
Check the docs for the current embed token flow before building a custom-domain integration from scratch.