Piwik not tracking since upgrade


I have implemented Piwik in a couple sites and haven’t looked at it for some months (what a shame). Since my last update from Piwik 1.2.x to 1.5 nothing is logged in the database anymore.

First thing I do, is to upgrade to 1.8.2 of course (after taking a backup) but I also want to find out what happened at my last upgrade and why nothing is being stored in MySQL anymore. I have no idea yet, but will put some prints in a copy of piwik.php to debug it.

Fortunately I found the logfiles which call the piwik.php with the correct parameters. I mean the apache logfiles where piwik is running, not the logfiles from the calling sites of course. So far, I haven’t seen any tool to import those, but I can write a small program which calls those logged accesses again. Would such a tool help the community or is it just a single problem that occured to me? Another solution would be to convert to piwik access-logfile to a regular access logfile, but then I would lose some javascript information (like resolution and so on). I appreciate any hints.

Thank you from Bavaria/Germany


I don’t know what the matter was with your first upgrade, but if it still doesn’t log after the upgrade to 1.8.X (not too obvious for me atm, thus just writing this) you will need to adjust the privileges of the MySQL user, he needs the additional ‘Lock Tables’ privilege.

Maybe something similar was the case during 1.2.x to 1.5?

So long,

Let’s see how the upgrade goes. I didn’t change anything to the MySQL configuration. Users, Privileges, etc are all the same.

It’s funny that I noticed it at all. I installed the Piwik Mobile App a while ago and thought it was outdated and couldn’t read the old statistics. I sill have to think about how to read the old logfiles. I might alter the piwik.php and add the fields that are not passed (IP, Browser, Referer) or just read the file, parse it on my own and call the API.

I really love the Piwik code. It’s so nice to read. I will also take the opportunity and replace Google Analytics for all sites I have access to.

you can import log files using the Log Import feature: Log Analytics - Analytics Platform - Matomo

Hi, I want to report back. The upgrade to 1.8.2 went well, still no tracking. I finally found the error. It was in the GeoIP-Plugin which changed the database structure between versions. There was a missing field in piwik_log_visit. I corrected everything and Piwik is working again.

I can’t use the import feature, since I don’t have access to the log files of the initiating site. But what I do have is the logfile from my server. Here is on example line:

78.xx.163.211 - - [02/Apr/2012:15:10:22 +0200] "GET /piwik.php?idsite=1&rec=1&url=http%3A%2F%2xxx.xx%2Fxx%2F&res=1920x1200&h=16&m=10&s=24&cookie=1&urlref=&rand=0.16119534075803844&pdf=1&qt=1&realp=0&wma=1&dir=0&fla=1&java=1&gears=0&ag=0&action_name=%2F200%2FURL%3D%2Fxx%2F%2FFrom%3D HTTP/1.1" 200 897 "http://refering.site/xxx/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0"

If you look closely, after the HTTP_ERROR_CODE (200) there is the 1x1 image pixel site, which should be 43. It was 897, since it contained also the error messages but never threw an error.

How should I go along? Write a module for the importer or parse and call the API?

I would parse the piwik.php logs and then replay them on piwik, with the same URL but adding the parameter “cdt” to specify the time and date, and also add “cip” to specify the IP. See: http://piwik.org/docs/tracking-api/reference/

Thanks matt, the suggested import process worked fine.

I wrote a small java program which parsed my log files for the relevant entries, added the cdt and cip parameters (as well es the token) wrote everything out to a file, ran curl with --referer and --user-agent options, truncated all archive_* tables, ran archive.php and done :slight_smile:

There was no issue with piwik, as I said it was the GeoIP Plugin where the last upgrade did not work so well.


i have installed piwik on my websites but it only seems to track 2-3 sites although i have added it on 90+ websites.

i have installed piwik on my websites but it only seems to track 2-3 sites although i have added it on 90+ websites.
can you check the error logs?


i have installed piwik on my websites but it only seems to track 2-3 sites although i have added it on 90+ websites.
can you check the error logs?[/quote]

yes i have but there are not errors in there :frowning: except for these:

404 and robots.txt

is there any solution to this? or do i have to install the script individually for each site :frowning:

Please try with latest beta: 301 Moved Permanently

if not working please let us know moreinfo : is there no visit showing in visitor lgos ? but the JS is there ?


i have installed piwik on my websites but it only seems to track 2-3 sites although i have added it on 90+ websites.[/quote]

Did you figure out a solution? I’m having a similar issue.


Two sites on the same server, different directories, tracked separately. One logs, the other does not.

tjmadsen , one of these 2 requests fail ?

Can you please enable $GLOBALS[‘PIWIK_TRACKER_DEBUG’] = true;
in the piwik.php file, then look at the response and find out why it is not tracking?


Was going to post the output from piwik.php after turning debug on, but it turns out that once I turned on debug, the tracking has begun again.

Turning debug on, then off again seems to have fixed the problem!

This site has not been working for weeks, glad it’s tracking again:

upgrading didn’t work as well so i have reverted back again and this is the message that i saw in the error log:

PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/bedlinen/public_html/wick/core/Archive/Single.php on line 258