Hi,
I’ve setup a Piwik installation which has two hostnames. One is for accessing UI (piwik.example.org), the other will be used for tracker (piwik-collector.example.org). For the tracker hostname, I’ve setup a vhost which only contains piwik.php and piwik.js. This works as expected.
Now I want to make it easier when getting the tracking code from the UI. As today when you’re using the UI hostname (piwik.example.org), you will see the UI hostname in the tracking code. I want to be able to see the tracker hostname (piwik-collector.example.org) in the tracking code instead.
I’ve tried to manually update the piwikUrl in the piwik_option table. But it is reverted to piwik.example.org whenever I access the UI. Another solution would be to update /plugins/Morpheus/templates/javascriptCode.tpl manually.
Worked like a charm. I noticed though that the ImageTrackerCode wasn’t updated with this. So I tried to update it by listening to ‘SitesManager.getImageTrackingCode’ [ developer.piwik.org ].
Then I created following function:
public function manipulateImageTrackingCode(&$piwikUrl, &$urlParams)
{
$piwikHost = $MY_URL;
}
But it won’t update the domain name. Not sure where I’m doing wrong. Any suggestions?