Is there a way to expose a different url in the tracking code Matomo shows?

I am using two DNS for my Matomo application. One is used to access the website and is protected behind SSO, and the other is used to communicate with the API. This means that I want the tracking code showing in the Matomo UI to use the second DNS used for the API calls. However, Matomo’s tracking code for each website use the first DNS. On the other hand, when I request the tracking code through the API, it shoes correctly the second DNS.