Server URL in tracking code (Internal/External)

Hi,

I’m new to Piwik.
On my new server, I have 2 trusted_host, one for internal use and one for external.
The external one will be use only for the tag.
My Internal one will be use to manage and view the stats.
When I generate a JavaScript tracking code with my Internal URL, the code report my internal URL.
How can I say to Piwik to always use my “external.exemple.com” URL instead of changing it manually?

(function() {
var u="//internal.exemple.com/";
_paq.push([‘setTrackerUrl’, u+‘piwik.php’]);
_paq.push([‘setSiteId’, ‘2’]);

Thanks!