I have moved the current Piwik installation from the service provider to our own server, but with different DNS name of the site. Because the Javascript has been inserted to every pages of a large number of sites and pages, I need to keep the old domain name. I did a website redirect (HTTP), but the URL in the Javascript with query string appended with idsite=“xxx” does not work with this HTTP site redirect,. What is the solution to this problem, except updating the Javascript (it may requires lots of work, as we have nearly 100 sites with many, many pages, many sites may not configured using SSI, so updating Javascript is only the last option…)?
Thanks so much. It does seem more complicated than what I thought originally. I will go through this and may be run some tests to see if which way works the best. It looks like the php “proxy” is the best one.
Having read through the ticket and comments, my impression was it still needs to update the javascript on each page of the site, and update or replace the piwik.php to each site Piwik tracks.
Looking into the javascript itself, the only site specific part is the pkBaseURL, which is my problem because the Piwik installation came from the other server. The current Piwik has a differnt domain name.
I do not understand the whole idea of the solution, and not sure if it can solve my problem. As I said, I already configured a redirect from the old site name to the new one, but it seems not working as no stats have been collected (no data).
I may end up with having to update the javascript on each page…
The solution proposed in the ticket does not involve changing the javascript, the proposed ‘piwik.php’ script becomes a proxy to both the JS and the Tracking request…
, to eery site that Piwik tracks stats, that’s it. But you did mention that “Then modify the top part of the Piwik JS snippet to the following”, which actuallly change the domain name to that of the target site. My understanding is the javascriopt must be updated with the sites’ URL for each site, let me know if I am wrong.
By the way, how to get $TOKEN_AUTH, when login in as super user (account when setup Piwik, also in the config file)? Can I have some instructions, please?