Getting different stats from browser archiving vs cron job

Medium traffic Piwik installation (approximately 15000 total visits, 19000 pageviews/day). We have 242 sites being tracked, with the largest having over 10,000 visits/day, and the lowest having… 0.

As a result, PHP frequently runs out of memory when trying to access the Dashboard, even though it’s been maxed out in the ini file. As recommended, I’m testing using a cron job to run archive.php using our development server to ease the load. (The production/live server still uses 30 min browser reports).

The site I’m using as a “test bunny” is one of our wikis (Mediawiki software), and it’s being tracked on both the live server and development server for comparison. One issue I’m seeing is that the visit counts are off. The live server (browser reporting) says we get around 2000-3000 users/day on the wiki, whereas the dev server (cron job) says there are only about 100.

Is this because I have two tracking codes embedded?

Additionally, the Page Titles aren’t being recorded on the development server. I think this also has to do with having 2 tracking codes, since I have a Sandbox Wiki tracked on only the development server, and it’s recording the Page Titles and URLs.

I’m hesitant to turn off the browser archiving on the live server right away, since we can’t afford to lose a day of reporting if things go wrong. However, it seems as though my testing using two codes is messing it up, since the Sandbox Wiki’s stats are coming through just fine.


This is most likely because of the two tracking codes. Please read up on using multiple trackers at:

The cron job is definitely the preferred choice for your setup! Browser archiving is only good when you have less than a few hundred visits.

Excellent, thanks Fabian!

One more question – do I have to stop browser reporting on the live site before doing a test of archive.php on the server end? (Basically, I want to manually run archive.php a couple fimes without using the scheduler to make sure it’s getting everything, and then set up the scheduler and turn off browser reporting.) If I leave it on, will it mess up our metrics, or will it sort out any duplicates?

You can leave it on… but it basically executes the same code as the archiver which in turn means that whenever you run the archiver your stats might already have been computed.