== Requirements ==
To run this properly you will need
Piwik server latest version
One or several website(s) to track with this Piwik server, for example http://example.com
The website to track must run on a server with PHP5 support
Also in your php.ini you must check that the following is set: “allow_url_fopen = On”
== How to track example.com in your Piwik without revealing the Piwik server URL? ==
In your Piwik server, login as Super user
create a user, set the login for example: “UserTrackingAPI”
Assign this user “admin” permission on all websites you wish to track without showing the Piwik URL
Copy the “token_auth” for this user, and paste it below in this file, in $TOKEN_AUTH = “xyz”
Edit below the $PIWIK_URL variable and put inside your Piwik server URL
Upload this modified piwik.php file in the website root directory, for example at: http://example.com/piwik.php
This file will be called by the Piwik Javascript, instead of calling directly the Piwik Server URL.
Go to Piwik > Settings > Websites > Show Javascript Tracking Code.
Copy the Javascript snippet. Then, edit this code and change the first lines to the following:
I visit my website but my visit isn’t tracked. What have i done wrong?
That is the response returning the Javascript piwik.js file. Then, you should see another tracking request. If not, check that you call .trackPageView() and that there is no JS error in the Firebug console?
The bug 1) and 2) are the same cause, that the IP is not set correctly. Please try: <?php var_dump($_SERVER);?> in a new php file on the website you are tracking (not the Piwik server) and paste output here or in PM thx
Sometimes i saw a user was tracked twice in piwik. Same time, ip, time spent on website etc. Maybe it has to do with it? But this happens not to often…