Proxy Script on PHP website, Can I just call PHP file?


Ok, we have many site and they are all on the same hosting account in the same directory.

I’m assuming the existing tracking code is designed mainly for compatibility with other types of files like HTML and more, but our websites are all in PHP so I’m wondering if instead of including the SCRIPT CODE if I can simply include the Proxy PHP file in our existing Code and pass the TrackingURL and SiteID to Piwik?

To make this more seamless; we already have a database of our domains so I would like to pass my existing SiteID and have it coincide with the SiteID in Piwik!

Should this be feasible?


(Matthieu Aubry) #2

The best is to use the Javascript code if possible as it’s more accurate. But sure you can generate the code in PHP, in fact you could even use the API SitesManager.getJavascriptTracking see: