I hide my footprints, but Piwik doesn't track visitors


#1

I followed these instructions very carefully:

== 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? ==

  1. In your Piwik server, login as Super user

  2. create a user, set the login for example: “UserTrackingAPI”

  3. Assign this user “admin” permission on all websites you wish to track without showing the Piwik URL

  4. Copy the “token_auth” for this user, and paste it below in this file, in $TOKEN_AUTH = “xyz”

  5. Edit below the $PIWIK_URL variable and put inside your Piwik server URL

  6. 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.

  7. 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?


#2

I’m having the EXACT same problem on one of my websites. What I’m I doing wrong??


(Matthieu Aubry) #3

To debug the Tracking API calls, you can see this doc how to use Firebug and enable debug logging

You should be able to see the problem and post it here


#4

[quote=matt]
To debug the Tracking API calls, you can see this doc how to use Firebug and enable debug logging

You should be able to see the problem and post it here[/quote]

This is what i get:

HTTP/1.1 304 Not Modified
Date: Tue, 31 Jan 2012 10:16:01 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Vary: Accept-Encoding

GET /piwik.php HTTP/1.1
Host: www.mydomain.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Cookie: PIWIK_SESSID=blabla
If-Modified-Since: Tue, 31 Jan 2012 10:15:33 GMT
Cache-Control: max-age=0

Content-Length 18936
Content-Type application/javascript; charset=UTF-8
Date Tue, 31 Jan 2012 10:16:01 GMT
Last-Modified Tue, 31 Jan 2012 10:15:33 GMT
Server Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Vary Accept-Encoding
X-Powered-By PHP/5.3.9


(Matthieu Aubry) #5

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?


#6

No, that is the piwik.php with a 304.

I did it again and now it shows 200.

I logged into piwik and i see that it tracked stats yesterday and today.

I changed NOTHING. How can it be?

I’ll try to add the other sites now :slight_smile:


#7

Ok, it’s working so far.

BUT still 2 problems:

  1. When a visitor comes to my site, i always see the ip of my hosting account.

  2. How can i exclude my visits from the stats? The cookie is not working and when i exclude my ip globally it’s not working too.

Thank you!


(Matthieu Aubry) #8

If you see the IP of your server for all visitors, it means that the IP is not collected properly by the script (and forwarded to Piwik). I created a ticket: When running piwik proxy php to hide footprint, IP address is not set correctly when the website being tracked is behind proxy · Issue #2900 · matomo-org/matomo · GitHub

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


#9

Thanks, i figured it out myself. Another user had the same problem. I added these lines:

[General]
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_host_headers[] = “HTTP_X_FORWARDED_HOST”

At the end of config.ini.php. And it’s working.

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…


(Matthieu Aubry) #10

please upgrade to 1.7 beta to have this bug (double visits) fixed: 301 Moved Permanently