Using updateQueryString to update browser URL in app on custom domain

I have a Shiny app deployed at, which is accessible to the public at a custom domain: (via a CNAME record).

The app uses updateQueryString to update the URL in response to user interaction. At, this works perfectly—the URL updates, and the updated URL can be used to return to a specific state at a later time.

For the custom domain, however, nothing happens: updateQueryString fails to update the URL.

Additionally, retrieving the window location in JS with window.location.href returns a link to the shinyapps version of the site, no matter which domain has actually been visited.

I'm hazily assuming these two facts are related: like, updateQueryString is failing on the custom domain, because it is trying to push a window state to a domain which is different from shinyapps.

So what is the path for updating the URL on a custom domain?